mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
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:
commit
373a3ece84
@ -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|
|
||||
// ||
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user