From ab743708fee2fbfeeaf1f680a02e45c149ce77e2 Mon Sep 17 00:00:00 2001 From: AdoHe Date: Sat, 4 Jun 2016 04:58:37 -0400 Subject: [PATCH] update ingress describe output --- pkg/kubectl/describe.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index c73e405347b..0116590d92f 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -1320,14 +1320,23 @@ func (i *IngressDescriber) describeIngress(ing *extensions.Ingress, describerSet } fmt.Fprint(out, "Rules:\n Host\tPath\tBackends\n") fmt.Fprint(out, " ----\t----\t--------\n") + count := 0 for _, rules := range ing.Spec.Rules { if rules.HTTP == nil { continue } - fmt.Fprintf(out, " %s\t\n", rules.Host) - for _, path := range rules.HTTP.Paths { - fmt.Fprintf(out, " \t%s \t%s (%s)\n", path.Path, backendStringer(&path.Backend), i.describeBackend(ing.Namespace, &path.Backend)) + count++ + host := rules.Host + if len(host) == 0 { + host = "*" } + fmt.Fprintf(out, " %s\t\n", host) + for _, path := range rules.HTTP.Paths { + fmt.Fprintf(out, " \t%s \t%s (%s)\n", path.Path, backendStringer(&path.Backend), i.describeBackend(ns, &path.Backend)) + } + } + if count == 0 { + fmt.Fprintf(out, " %s\t%s \t%s (%s)\n", "*", "*", backendStringer(def), i.describeBackend(ns, def)) } describeIngressAnnotations(out, ing.Annotations)