Merge pull request #24475 from k82/k8s-24411

Automatic merge from submit-queue

Clarify `kubectl get service` output.

Pull request for #24411 .
This commit is contained in:
k8s-merge-robot 2016-04-26 13:45:09 -07:00
commit 373a3ece84
2 changed files with 8 additions and 5 deletions

View File

@ -766,8 +766,8 @@ func Example_printServiceWithNamespacesAndLabels() {
}
// Output:
// |NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE L1|
// |ns1 svc1 10.1.1.1 unknown 53/UDP,53/TCP 10y value|
// |ns2 svc2 10.1.1.2 unknown 80/TCP,8080/TCP 10y dolla-bill-yall|
// |ns1 svc1 10.1.1.1 <unknown> 53/UDP,53/TCP 10y value|
// |ns2 svc2 10.1.1.2 <unknown> 80/TCP,8080/TCP 10y dolla-bill-yall|
// ||
}

View File

@ -881,16 +881,19 @@ func getServiceExternalIP(svc *api.Service) string {
if len(svc.Spec.ExternalIPs) > 0 {
return strings.Join(svc.Spec.ExternalIPs, ",")
}
return "nodes"
return "<nodes>"
case api.ServiceTypeLoadBalancer:
lbIps := loadBalancerStatusStringer(svc.Status.LoadBalancer)
if len(svc.Spec.ExternalIPs) > 0 {
result := append(strings.Split(lbIps, ","), svc.Spec.ExternalIPs...)
return strings.Join(result, ",")
}
return lbIps
if len(lbIps) > 0 {
return lbIps
}
return "<pending>"
}
return "unknown"
return "<unknown>"
}
func makePortString(ports []api.ServicePort) string {