Ensure public IP removed after service deleted

This commit is contained in:
Pengfei Ni 2018-02-05 14:40:52 +08:00
parent 551f73d324
commit e2eaccb829

View File

@ -383,10 +383,12 @@ func (az *Cloud) findServiceIPAddress(clusterName string, service *v1.Service, i
return "", err return "", err
} }
if !existsLb { if !existsLb {
return "", fmt.Errorf("Expected to find an IP address for service %s but did not", service.Name) glog.V(2).Infof("Expected to find an IP address for service %s but did not. Assuming it has been removed", service.Name)
return "", nil
} }
if len(lbStatus.Ingress) < 1 { if len(lbStatus.Ingress) < 1 {
return "", fmt.Errorf("Expected to find an IP address for service %s but it had no ingresses", service.Name) glog.V(2).Infof("Expected to find an IP address for service %s but it had no ingresses. Assuming it has been removed", service.Name)
return "", nil
} }
return lbStatus.Ingress[0].IP, nil return lbStatus.Ingress[0].IP, nil