Gracefully handle static ip deletion failure

This commit is contained in:
Nick Sardo 2017-04-26 10:23:19 -07:00
parent f704d81c16
commit b8f81c0405

View file

@ -893,9 +893,10 @@ func (l *L7) Cleanup() error {
l.fws = nil l.fws = nil
} }
if l.ip != nil { if l.ip != nil {
glog.Infof("Deleting static IP %v(%v)", l.ip.Name, l.ip.Address) glog.V(2).Infof("Deleting static IP %v(%v)", l.ip.Name, l.ip.Address)
// Ignore err when deleting static IP since multiple ingresses could be sharing one
if err := utils.IgnoreHTTPNotFound(l.cloud.DeleteGlobalStaticIP(l.ip.Name)); err != nil { if err := utils.IgnoreHTTPNotFound(l.cloud.DeleteGlobalStaticIP(l.ip.Name)); err != nil {
return err glog.Warningf("Failed to delete global static ip %v (%v), but will continue with remaining cleanup. err: %v", l.ip.Name, l.ip.Address, err)
} }
l.ip = nil l.ip = nil
} }