Skip to content

Commit

Permalink
[gce]: DeleteInstances 409 case
Browse files Browse the repository at this point in the history
continue on 409s as the operation already exists
  • Loading branch information
Freyert committed Sep 15, 2022
1 parent b042aae commit f5e6fea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ 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()
if err != nil {
wasConflictErr := op != nil && op.HttpErrorStatusCode == http.StatusConflict
if !wasConflictErr && err != nil {
return err
}
return client.waitForOp(op, migRef.Project, migRef.Zone, true)
Expand Down

0 comments on commit f5e6fea

Please sign in to comment.