@@ -47,6 +47,8 @@ func (ctrl *resizeController) markControllerResizeInProgress(
4747 newPVC .Status .Conditions = util .MergeResizeConditionsOfPVC (newPVC .Status .Conditions , conditions , true /*keepOldResizeConditions*/ )
4848 }
4949
50+ newPVC = ctrl .removeNodeExpansionNotRequiredAnnotation (newPVC )
51+
5052 if updateStatus {
5153 newPVC = mergeStorageResourceStatus (newPVC , v1 .PersistentVolumeClaimControllerResizeInProgress )
5254 }
@@ -78,6 +80,9 @@ func (ctrl *resizeController) markForPendingNodeExpansion(pvc *v1.PersistentVolu
7880 newPVC .Status .Conditions = util .MergeResizeConditionsOfPVC (newPVC .Status .Conditions ,
7981 []v1.PersistentVolumeClaimCondition {pvcCondition }, true /*keepOldResizeConditions*/ )
8082
83+ // make sure if any annotation was previously added is removed here
84+ newPVC = ctrl .removeNodeExpansionNotRequiredAnnotation (newPVC )
85+
8186 newPVC = mergeStorageResourceStatus (newPVC , v1 .PersistentVolumeClaimNodeResizePending )
8287 updatedPVC , err := util .PatchClaim (ctrl .kubeClient , pvc , newPVC , true /* addResourceVersionCheck */ )
8388
@@ -173,6 +178,8 @@ func (ctrl *resizeController) markOverallExpansionAsFinished(
173178 newPVC .Status .AllocatedResourceStatuses = resourceStatusMap
174179 }
175180
181+ newPVC = ctrl .addNodeExpansionNotRequiredAnnotation (newPVC )
182+
176183 updatedPVC , err := util .PatchClaim (ctrl .kubeClient , pvc , newPVC , true /* addResourceVersionCheck */ )
177184 if err != nil {
178185 return pvc , fmt .Errorf ("mark PVC %q as resize finished failed: %v" , klog .KObj (pvc ), err )
0 commit comments