mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Fix provisioned GCE PD not being reused if already exists
This commit is contained in:
parent
98c66f9fca
commit
11cb36e9dc
@ -245,7 +245,10 @@ func (gce *GCECloud) CreateDisk(
|
||||
|
||||
mc := newDiskMetricContext("create", zone)
|
||||
createOp, err := gce.service.Disks.Insert(gce.projectID, zone, diskToCreate).Do()
|
||||
if err != nil {
|
||||
if isGCEError(err, "alreadyExists") {
|
||||
glog.Warningf("GCE PD %q already exists, reusing", name)
|
||||
return nil
|
||||
} else if err != nil {
|
||||
return mc.Observe(err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user