update ingress describe output

This commit is contained in:
AdoHe 2016-06-04 04:58:37 -04:00
parent 77de942e08
commit ab743708fe

View File

@ -1320,14 +1320,23 @@ func (i *IngressDescriber) describeIngress(ing *extensions.Ingress, describerSet
} }
fmt.Fprint(out, "Rules:\n Host\tPath\tBackends\n") fmt.Fprint(out, "Rules:\n Host\tPath\tBackends\n")
fmt.Fprint(out, " ----\t----\t--------\n") fmt.Fprint(out, " ----\t----\t--------\n")
count := 0
for _, rules := range ing.Spec.Rules { for _, rules := range ing.Spec.Rules {
if rules.HTTP == nil { if rules.HTTP == nil {
continue continue
} }
fmt.Fprintf(out, " %s\t\n", rules.Host) count++
for _, path := range rules.HTTP.Paths { host := rules.Host
fmt.Fprintf(out, " \t%s \t%s (%s)\n", path.Path, backendStringer(&path.Backend), i.describeBackend(ing.Namespace, &path.Backend)) 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) describeIngressAnnotations(out, ing.Annotations)