Skip to content

Commit

Permalink
log MIG delete conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Freyert committed Sep 26, 2022
1 parent f5e6fea commit 1ca89a9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cluster-autoscaler/cloudprovider/gce/autoscaling_gce_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,14 @@ func (client *autoscalingGceClientV1) DeleteInstances(migRef GceRef, instances [
req.Instances = append(req.Instances, GenerateInstanceUrl(i))
}
op, err := client.gceService.InstanceGroupManagers.DeleteInstances(migRef.Project, migRef.Zone, migRef.Name, &req).Do()
wasConflictErr := op != nil && op.HttpErrorStatusCode == http.StatusConflict
if !wasConflictErr && err != nil {
return err

if err != nil {
if op != nil && op.HttpErrorStatusCode == http.StatusConflict {
klog.V(4).Infof("conflicting MIG delete request for %s %s %s: %v", migRef.Project, migRef.Zone, migRef.Name, op.HttpErrorMessage)
} else {
return err
}

}
return client.waitForOp(op, migRef.Project, migRef.Zone, true)
}
Expand Down

0 comments on commit 1ca89a9

Please sign in to comment.