mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #38702 from jsafrane/gce-provisioning-existing
Automatic merge from submit-queue (batch tested with PRs 38702, 41810, 41778, 41858, 41872) gce: Reuse unsuccessfully provisioned volumes. GCE PD names generated by Kubernetes are guaranteed to be unique - they contain name of the cluster and UID of the PVC that is behind it. Presence of a GCE PD that has the same name as we want to provision indicates that previous provisioning did not go well and most probably the controller manager process was restarted in the meantime. Kubernetes should reuse this volume and not provision a new one. Fixes #38681
This commit is contained in:
commit
616d929828
@ -2484,7 +2484,12 @@ func (gce *GCECloud) CreateDisk(name string, diskType string, zone string, sizeG
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return gce.waitForZoneOp(createOp, zone)
|
err = gce.waitForZoneOp(createOp, zone)
|
||||||
|
if isGCEError(err, "alreadyExists") {
|
||||||
|
glog.Warningf("GCE PD %q already exists, reusing", name)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gce *GCECloud) doDeleteDisk(diskToDelete string) error {
|
func (gce *GCECloud) doDeleteDisk(diskToDelete string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user