Skip to content

Commit

Permalink
Ignore instance groups in use
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Sardo committed Aug 2, 2017
1 parent 504bf92 commit 27e42e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/gce/instances/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,15 @@ func (i *Instances) DeleteInstanceGroup(name string) error {
}
for _, zone := range zones {
if err := i.cloud.DeleteInstanceGroup(name, zone); err != nil {
if !utils.IsHTTPErrorCode(err, http.StatusNotFound) {
if utils.IsNotFoundError(err) {
glog.V(3).Infof("Instance group %v in zone %v did not exist", name, zone)
} else if utils.IsInUsedByError(err) {
glog.V(3).Infof("Could not delete instance group %v in zone %v because it's still in use. Ignoring: %v", name, zone, err)
} else {
errs = append(errs, err)
}
} else {
glog.Infof("Deleted instance group %v in zone %v", name, zone)
glog.V(3).Infof("Deleted instance group %v in zone %v", name, zone)
}
}
if len(errs) == 0 {
Expand Down

0 comments on commit 27e42e9

Please sign in to comment.