[WIP] feat: support changing cachingMode through VolumeAttributeClass#3584
[WIP] feat: support changing cachingMode through VolumeAttributeClass#3584andyzhangx wants to merge 2 commits intokubernetes-sigs:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
53abd35 to
5af5d6f
Compare
5f0ea93 to
9c1c857
Compare
In ControllerModifyVolume: - Validate the cachingMode parameter - Enforce caching limits (disks >= 4 TiB support only None) - Enforce PremiumV2_LRS constraint (only None) - Pass cachingMode to ModifyDisk via ManagedDiskOptions In ModifyDisk: - Accept CachingMode in ManagedDiskOptions - Log cachingMode update (applied on next ControllerPublishVolume attach) Note: cachingMode is a VM-level data disk attachment property, not a disk resource property. The new value is persisted in PV volumeAttributes via VolumeAttributeClass and takes effect on next ControllerPublishVolume. Fixes: kubernetes-sigs#3471
9c1c857 to
0048abf
Compare
Add modify-volume-params.yaml with cachingmode: ReadOnly and pass --csi.testvolumemutableparameters to csi-sanity so ModifyVolume tests exercise the real cachingMode code path instead of empty parameters.
|
@andyzhangx: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds support for changing
cachingModeviaVolumeAttributeClassby validating the parameter inControllerModifyVolumeand updating the disk's caching mode on the VM in-place.How it works
cachingModeis a VM-level data disk attachment property. When modified via VolumeAttributeClass:ControllerModifyVolumevalidates the new cachingMode valueNone; PremiumV2_LRS only supportsNoneUpdateDiskCachingModewhich:disk.ManagedByAttachDiskcall with the existing LUN and new cachingMode to update the VMvolumeAttributesChanges
azure_controller_common.go: AddedUpdateDiskCachingModemethod oncontrollerCommoncontrollerserver.go: Added cachingMode validation and update logic inControllerModifyVolumecontrollerserver_test.go: Added 4 unit test cases (3 valid modes + 1 invalid)Example VolumeAttributeClass
Which issue(s) this PR fixes:
Fixes #3471
Special notes for your reviewer:
None,ReadOnly,ReadWrite