Support cachingMode modification through VolumeAttributeClass#3472
Support cachingMode modification through VolumeAttributeClass#3472
Conversation
|
Hi @Copilot. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
- Parse and validate cachingMode from MutableParameters in ControllerModifyVolume - Add validation for PremiumV2_LRS and UltraSSD_LRS (only None caching mode) - Add comprehensive unit tests for cachingMode modification scenarios - Update documentation (driver-parameters.md and modifyvolume README) - Add example VolumeAttributesClass with cachingMode Co-authored-by: andyzhangx <4178417+andyzhangx@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Copilot The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
- Extract ValidateCachingModeForSKU function to eliminate code duplication - Rename targetSKU to effectiveSKU for better clarity - Add comprehensive unit tests for ValidateCachingModeForSKU - Update both ParseDiskParameters and ControllerModifyVolume to use shared validation Co-authored-by: andyzhangx <4178417+andyzhangx@users.noreply.github.com>
- Add getDiskSKUName helper function to simplify nested nil checks - Fix typo in GetAttachDiskInitialDelay comment Co-authored-by: andyzhangx <4178417+andyzhangx@users.noreply.github.com>
Problem
The
cachingModeparameter could only be set at volume creation time. Users needed to recreate volumes to change caching behavior.Solution
Add
cachingModesupport toControllerModifyVolume. Since cachingMode is an attachment-level property (not persisted in Azure disk metadata), the driver validates the parameter and the external-resizer updates the PV's volumeAttributes. The new caching mode applies on next attachment.Changes
Validation logic
ValidateCachingModeForSKU()function to validate compatibility (PremiumV2_LRS and UltraSSD_LRS requireNone)ParseDiskParameters()andControllerModifyVolume()ControllerModifyVolume
cachingModefrom MutableParametersgetDiskSKUName()helper for safe SKU extractionDocumentation
Example Usage
After patching a PVC to use this VAC, the caching mode changes take effect when the volume is re-attached (pod restart, node restart, etc.).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
login.microsoftonline.com/tmp/go-build1834556328/b001/azuredisk.test /tmp/go-build1834556328/b001/azuredisk.test -test.testlogfile=/tmp/go-build1834556328/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true driver/azuredisk-errorsas cfg ux_amd64/vet /fileserviceprop/opt/hostedtoolcache/go/1.24.11/x64/pkg/tool/linux_amd64/vet /fileserviceprop-atomic -lang=go1.24 ux_amd64/vet -o 412366/b1103/_pk-errorsas k/azuredisk-csi--ifaceassert ux_amd64/vet tion_v1/reflectiumount tion_v1/reflecti/tmp/kubelet-detect-safe-umount373984403 -lang=go1.24 ux_amd64/vet(dns block)/tmp/go-build85801472/b1217/azuredisk.test /tmp/go-build85801472/b1217/azuredisk.test -test.testlogfile=/tmp/go-build85801472/b1217/testlog.txt -test.paniconexit0 -test.gocoverdir=/tmp/go-build85801472/b1217/gocoverdir -test.timeout=10m0s -test.v=true cfg ux_amd64/vet til.go k8s.io/client-go/tmp/kubelet-detect-safe-umount2871886555 -lang=go1.24 ux_amd64/vet(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
cachingModethroughVolumeAttributeClass#3471✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.