kubernetes-csi / csi-test

CSI test frameworks
Apache License 2.0
158 stars 147 forks source link

Test ControllerModifyVolume for "Values specified in mutable_parameters MUST take precedence over the values from parameters" #549

Open AndrewSirenko opened 2 months ago

AndrewSirenko commented 2 months ago

TLDR: The ControllerModifyVolume RPC sanity tests added in PR #538 do not cover the CSI Spec requirement of 'Values specified in mutable_parameters MUST take precedence over the values from parameters.` However, the current best idea for adding this test would require yet another csi-sanity test file, which is a confusing experience for CSI Driver maintainers.


An issue I had implementing this test case is that parameters & mutable_parameters are opaque, and therefore CSI components have no visibility into created volume respecting the precedence.

One way we could potentially test this is by finding a shared parameter + mutable_parameter (looping through the two lists), and forcing the mutable_parameter to be invalid. If the driver would return INVALID_ARGUMENTS error code, it suggests that precedence is respected, and the test would pass.

However, I was afraid that this would be too 'hacky' of a test to add, because we don't know if there are shared parameters, or what an invalid parameter might be.


Hemant suggested that the CSI Driver writer can pass in an additional flag where a shared parameter name can be passed, and requiring that this flag be passed if driver implements the ModifyVolume RPC. With this + the invalid_arguments precedence test above we could test this CSI Spec requirement.

Pros:

Cons:


I'll go create a PR with this test and additional flag sometime mid-August, and then we can debate its inclusion once we see the code. But in meantime, I am all ears for a better idea.

/assign