mirror of https://github.com/k3s-io/k3s
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.pull/6/head
parent
dbb8bf5274
commit
ba6ab902c9
|
@ -2484,7 +2484,12 @@ func (gce *GCECloud) CreateDisk(name string, diskType string, zone string, sizeG
|
|||
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 {
|
||||
|
|
Loading…
Reference in New Issue