Fix panic in GCE loadbalancer library

pull/6/head
Marek Grabowski 2017-11-24 13:25:38 +00:00
parent 58fca39de3
commit 94b6a1fb70
1 changed files with 4 additions and 1 deletions

View File

@ -344,7 +344,10 @@ func (gce *GCECloud) ensureExternalLoadBalancerDeleted(clusterName, clusterID st
glog.Infof("ensureExternalLoadBalancerDeleted(%s): Failed to retrieve health check:%v.", lbRefStr, err)
return err
}
hcNames = append(hcNames, hcToDelete.Name)
// If we got 'StatusNotFound' LB was already deleted and it's safe to ignore.
if err == nil {
hcNames = append(hcNames, hcToDelete.Name)
}
} else {
// EnsureLoadBalancerDeleted() could be triggered by changing service from
// LoadBalancer type to others. In this case we have no idea whether it was