@@ -175,24 +175,28 @@ type PersistentVolumeClaimSpec struct {
175175// PersistentVolumeClaimStatus represents the status of PV claim 
176176type PersistentVolumeClaimStatus struct { 
177177  ... 
178-   // The VolumeAttributesClassName string cannot be empty 
179-   VolumeAttributesClassName string 
180-   ModifyVolumeStatus *PersistentVolumeClaimModifyVolumeStatus 
178+   ModifyVolumeStatus ModifyVolumeStatus 
181179  ... 
182180} 
183181
182+ type ModifyVolumeStatus struct { 
183+   ActualVolumeAttributesClassName string 
184+   TargetVolumeAttributesClassName string 
185+   Status *PersistentVolumeClaimModifyVolumeStatus 
186+ } 
187+ 
184188// +enum 
185189type PersistentVolumeClaimModifyVolumeStatus string 
186190
187191const ( 
188192  // When modify volume is complete, the empty string is set by modify volume controller. 
189-   PersistentVolumeClaimNoModifyVolumeInProgress  PersistentVolumeClaimModifyVolumeStatus = "" 
193+   PersistentVolumeClaimNoModifyVolumeInSucceeded  PersistentVolumeClaimModifyVolumeStatus = "" 
190194  // State set when modify volume controller starts modifying the volume in control-plane 
195+   // When the request has been rejected as invalid by the CSI driver. To resolve this error, 
196+   // the PersistentVolumeClaim needs to specify a valid VolumeAttributesClass. 
191197  PersistentVolumeClaimControllerModifyVolumeInProgress PersistentVolumeClaimModifyVolumeStatus = "ControllerModifyVolumeInProgress" 
192198  // State set when modify volume has failed in modify volume controller with a terminal error. 
193-   // Transient errors such as timeout should not set this status and should leave ModifyVolumeStatus 
194-   // unmodified, so as modify volume controller can resume the volume modification. 
195-   PersistentVolumeClaimControllerModifyVolumeFailed PersistentVolumeClaimModifyVolumeStatus = "ControllerModifyVolumeFailed" 
199+   PersistentVolumeClaimControllerModifyVolumeInfeasible PersistentVolumeClaimModifyVolumeStatus = "ControllerModifyVolumeInfeasible" 
196200) 
197201
198202``` 
@@ -208,30 +212,44 @@ The CSI create request will be extended to add mutable parameters. A new Control
208212// ControllerServer is the server API for Controller service. 
209213type ControllerServer interface { 
210214    ... 
211-     rpc ControllerModifyVolume (ModifyVolumeRequest ) 
212-         returns (ModifyVolumeResponse ) { 
215+     rpc ControllerModifyVolume (ControllerModifyVolumeRequest ) 
216+         returns (ControllerModifyVolumeResponse ) { 
213217            option (alpha_method) = true; 
214218        } 
215219    ... 
216220} 
217221
218- message ModifyVolumeRequest  { 
222+ message ControllerModifyVolumeRequest  { 
219223  // Contains identity information for the existing volume. 
220224  // This field is REQUIRED. 
221-   string volume_id = 1 
222-   // This field is OPTIONAL.This allows the CO to specify the 
223-   // mutable parameters to apply.  
224-   map<string, string> mutable_parameters = 2; 
225+   string volume_id = 1; 
226+ 
227+   // Secrets required by plugin to complete modify volume request. 
228+   // This field is OPTIONAL. Refer to the `Secrets Requirements` 
229+   // section on how to use this field. 
230+   map<string, string> secrets = 2 [(csi_secret) = true]; 
231+ 
232+   // Plugin specific volume attributes to mutate, passed in as  
233+   // opaque key-value pairs.  
234+   // This field is REQUIRED. The Plugin is responsible for 
235+   // parsing and validating these parameters. COs will treat these 
236+   // as opaque. The CO SHOULD specify the intended values of all mutable 
237+   // parameters it intends to modify. SPs MUST NOT modify volumes based 
238+   // on the absence of keys, only keys that are specified should result 
239+   // in modifications to the volume. 
240+   map<string, string> mutable_parameters = 3; 
225241} 
226- message ModifyVolumeResponse  {} 
242+ message ControllerModifyVolumeResponse  {} 
227243
228244message CreateVolumeRequest { 
229245  ... 
230246  // See CreateVolumeRequest.parameters. 
231247  // This field is OPTIONAL. 
232248  map<string, string> parameters = 4; 
233-   // This field is OPTIONAL. This allows the CO to specify the 
234-   // volume attributes class parameters to apply.  
249+   // Plugins MUST treat these  
250+   // as if they take precedence over the parameters field. 
251+   // This field SHALL NOT be specified unless the SP has the 
252+   // MODIFY_VOLUME plugin capability. 
235253  map<string, string> mutable_parameters = 8; 
236254} 
237255``` 
@@ -275,6 +293,7 @@ apiVersion: storage.k8s.io/v1alpha1
275293kind: VolumeAttributesClass 
276294metadata: 
277295  name: silver 
296+ driverName: pd.csi.storage.gke.io 
278297parameters: 
279298  iops: "500" 
280299  throughput: "50MiB/s" 
@@ -318,6 +337,7 @@ apiVersion: storage.k8s.io/v1alpha1
318337kind: VolumeAttributesClass 
319338metadata: 
320339  name: silver 
340+ driverName: pd.csi.storage.gke.io 
321341parameters: 
322342  iops: "500" 
323343  throughput: "50MiB/s" 
@@ -345,6 +365,7 @@ apiVersion: storage.k8s.io/v1alpha1
345365kind: VolumeAttributesClass 
346366metadata: 
347367  name: gold 
368+ driverName: pd.csi.storage.gke.io 
348369parameters: 
349370  iops: "1000" 
350371  throughput: "100MiB/s" 
@@ -409,12 +430,24 @@ The resource quota controller is the only component capable of monitoring and re
409430### 3. Add new statuses in PVC API to indicate changes of VolumeAttributesClass and the status of the ModifyVolume operation.  
410431
411432``` 
412- type VolumeAttributesClassStatus string 
433+ type ModifyVolumeStatus struct { 
434+   ActualClassName string 
435+   TargetClassName string 
436+   Status *PersistentVolumeClaimModifyVolumeStatus 
437+ } 
438+ 
439+ // +enum 
440+ type PersistentVolumeClaimModifyVolumeStatus string 
413441
414442const ( 
415-     PersistentVolumeClaimControllerModifyVolumeProgress VolumeAttributesClassStatus = "ControllerModifyVolumeInProgress" 
416-     PersistentVolumeClaimControllerModifyVolumePending VolumeAttributesClassStatus = "ControllerModifyVolumePending" 
417-     PersistentVolumeClaimControllerModifyVolumeFailed VolumeAttributesClassStatus = "ControllerModifyVolumeFailed" 
443+   // When modify volume is complete, the empty string is set by modify volume controller. 
444+   PersistentVolumeClaimNoModifyVolumeInSucceeded PersistentVolumeClaimModifyVolumeStatus = "" 
445+   // State set when modify volume controller starts modifying the volume in control-plane 
446+   // When the request has been rejected as invalid by the CSI driver. To resolve this error, 
447+   // the PersistentVolumeClaim needs to specify a valid VolumeAttributesClass. 
448+   PersistentVolumeClaimControllerModifyVolumeInProgress PersistentVolumeClaimModifyVolumeStatus = "ControllerModifyVolumeInProgress" 
449+   // State set when modify volume has failed in modify volume controller with a terminal error. 
450+   PersistentVolumeClaimControllerModifyVolumeInfeasible PersistentVolumeClaimModifyVolumeStatus = "ControllerModifyVolumeInfeasible" 
418451) 
419452``` 
420453### 4. Add new CSI API ControllerModifyVolume, when there is a change of VolumeAttributesClass in PVC, external-resizer triggers a ControllerModifyVolume operation against a CSI endpoint. A Controller Plugin MUST implement this RPC call if it has MODIFY_VOLUME capability.   
@@ -454,7 +487,7 @@ There are a few conditions that will trigger add/remove pvc finalizers in the Vo
4544871 .  PVC created with a VolumeAttributesClass
455488
456489    The ** VACObjectInUseProtection admission controller** :
457-     *  Check if the VolumeAttributesClass exists. If not, the PVC will enter the PENDING  state because we do not want to impose ordering on object creation
490+     *  Check if the VolumeAttributesClass exists. If not, the PVC will enter the INPROGRESS  state because we do not want to impose ordering on object creation
458491    *  Check if this VolumeAttributesClass already has a protection finalizer
459492    *  Add the finalizer to the VolumeAttributesClass if there is none 
4604932 .  PVC created with a VolumeAttributesClass being deleted
@@ -480,7 +513,7 @@ For unbound PVs referencing a VAC:
480513
4815141 .  Unbound PV created with a VolumeAttributesClass
482515    The ** VACObjectInUseProtection admission controller** :
483-     *  Check if the VolumeAttributesClass exists. If not, the PV will enter the PENDING  state because we do not want to impose ordering on object creation
516+     *  Check if the VolumeAttributesClass exists. If not, the PV will enter the INPROGRESS  state because we do not want to impose ordering on object creation
484517    *  Check if this VolumeAttributesClass already has a protection finalizer
485518    *  Add the finalizer to the VolumeAttributesClass if there is none
4865192 .  PV has a VolumeAttributesClass and this PV is deleted
@@ -496,6 +529,7 @@ apiVersion: storage.k8s.io/v1alpha1
496529kind: VolumeAttributesClass 
497530metadata: 
498531  name: silver 
532+ driverName: pd.csi.storage.gke.io 
499533parameters: 
500534  iops: "500" 
501535  throughput: "50MiB/s" 
@@ -569,6 +603,7 @@ apiVersion: storage.k8s.io/v1alpha1
569603kind: VolumeAttributesClass 
570604metadata: 
571605  name: gold 
606+ driverName: pd.csi.storage.gke.io 
572607parameters: 
573608  iops: "1000" 
574609  throughput: "100MiB/s" 
@@ -593,7 +628,7 @@ spec:
593628
594629ModifyVolume is only allowed on bound PVCs. Under the ModifyVolume call, it will pass in the mutable parameters and do the update operation based on the ` VolumeAttributesClass `  parameters.
595630
596- ![ ModifyVolume Flow Diagram] ( ./VolumeAttributesClass-ModifyVolume-Flow.png ) 
631+ ![ ModifyVolume Flow Diagram] ( ./VolumeAttributesClass-ModifyVolume-Flow-v2 .png ) 
597632
598633### Implementation & Handling Failure  
599634
0 commit comments