Add LoadBalancer status to ServiceStatus

This will replace publicIPs
This commit is contained in:
Justin Santa Barbara
2015-05-22 17:33:29 -04:00
parent 1ad4549f5f
commit 3884d5fc59
21 changed files with 500 additions and 95 deletions

View File

@@ -72,9 +72,14 @@ func RunClusterInfo(factory *cmdutil.Factory, out io.Writer, cmd *cobra.Command)
services := r.Object.(*api.ServiceList).Items
for _, service := range services {
var link string
if len(service.Spec.PublicIPs) > 0 {
if len(service.Status.LoadBalancer.Ingress) > 0 {
ingress := service.Status.LoadBalancer.Ingress[0]
ip := ingress.IP
if ip == "" {
ip = ingress.Hostname
}
for _, port := range service.Spec.Ports {
link += "http://" + service.Spec.PublicIPs[0] + ":" + strconv.Itoa(port.Port) + " "
link += "http://" + ip + ":" + strconv.Itoa(port.Port) + " "
}
} else {
link = client.Host + "/api/v1beta3/proxy/namespaces/" + service.ObjectMeta.Namespace + "/services/" + service.ObjectMeta.Name