Commit e2eaccb8 authored by Pengfei Ni's avatar Pengfei Ni

Ensure public IP removed after service deleted

parent 551f73d3
......@@ -383,10 +383,12 @@ func (az *Cloud) findServiceIPAddress(clusterName string, service *v1.Service, i
return "", err
}
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 {
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment