Merge pull request #67630 from houjun41544/20180820

Check for pvcVolume with IsOperationPending() before markPVCResizeInProgress()
pull/564/head
Kubernetes Prow Robot 2019-02-11 16:24:06 -08:00 committed by GitHub
commit 126bb3b8ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -64,6 +64,11 @@ func (rc *syncResize) Sync() {
// Resize PVCs that require resize
for _, pvcWithResizeRequest := range rc.resizeMap.GetPVCsWithResizeRequest() {
uniqueVolumeKey := v1.UniqueVolumeName(pvcWithResizeRequest.UniquePVCKey())
if rc.opsExecutor.IsOperationPending(uniqueVolumeKey, "") {
klog.V(10).Infof("Operation for PVC %s is already pending", pvcWithResizeRequest.QualifiedName())
continue
}
updatedClaim, err := markPVCResizeInProgress(pvcWithResizeRequest, rc.kubeClient)
if err != nil {
klog.V(5).Infof("Error setting PVC %s in progress with error : %v", pvcWithResizeRequest.QualifiedName(), err)
@ -73,10 +78,6 @@ func (rc *syncResize) Sync() {
pvcWithResizeRequest.PVC = updatedClaim
}
if rc.opsExecutor.IsOperationPending(uniqueVolumeKey, "") {
klog.V(10).Infof("Operation for PVC %v is already pending", pvcWithResizeRequest.QualifiedName())
continue
}
growFuncError := rc.opsExecutor.ExpandVolume(pvcWithResizeRequest, rc.resizeMap)
if growFuncError != nil && !exponentialbackoff.IsExponentialBackoff(growFuncError) {
klog.Errorf("Error growing pvc %s with %v", pvcWithResizeRequest.QualifiedName(), growFuncError)