From 27e42e9067c0494475dec07a848ddd092d5dcf01 Mon Sep 17 00:00:00 2001 From: Nick Sardo Date: Wed, 2 Aug 2017 15:39:25 -0700 Subject: [PATCH] Ignore instance groups in use --- controllers/gce/instances/instances.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/gce/instances/instances.go b/controllers/gce/instances/instances.go index 34dc33db4a..94664b065f 100644 --- a/controllers/gce/instances/instances.go +++ b/controllers/gce/instances/instances.go @@ -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 {