Skip to content

Commit f22f043

Browse files
committed
Check for volume group existing before updating vg metadata
Reduce new image tag to below 1.14, bump it from 1.13.2 to 1.13.3 Replace return with continue so we don't break out of infinite loop
1 parent 3ffb6af commit f22f043

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

deploy/kubernetes/images/stable-master/image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ imageTag:
5151
name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
5252
# pdImagePlaceholder in test/k8s-integration/main.go is updated automatically with the newTag
5353
newName: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
54-
newTag: "v1.17.2"
54+
newTag: "v1.13.3"
5555
---

pkg/gce-pd-csi-driver/cache.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,17 +618,23 @@ func watchDiskDetaches(watcher *fsnotify.Watcher, nodeName string, errorCh chan
618618
errorCh <- fmt.Errorf("disk update event errored: %v", err)
619619
// watch for events
620620
case <-watcher.Events:
621+
vgName := getVolumeGroupName(nodeName)
622+
if !checkVgExists(vgName) {
623+
// If the volume group doesn't exist, there's nothing to update.
624+
// Continue to the next event.
625+
continue
626+
}
621627
// In case of an event i.e. creation or deletion of any new PV, we update the VG metadata.
622628
// This might include some non-LVM changes, no harm in updating metadata multiple times.
623629
args := []string{
624630
"--updatemetadata",
625-
getVolumeGroupName(nodeName),
631+
vgName,
626632
}
627633
_, err := common.RunCommand("" /* pipedCmd */, nil /* pipedCmdArg */, "vgck", args...)
628634
if err != nil {
629635
klog.Errorf("Error updating volume group's metadata: %v", err)
630636
}
631-
reduceVolumeGroup(getVolumeGroupName(nodeName), true)
637+
reduceVolumeGroup(vgName, true)
632638
}
633639
}
634640
}

0 commit comments

Comments
 (0)