Merge pull request #108506 from jlsong01/fix_kubectl_ingress_default_backend
fix kubectl describe ingress shows default-backend:80 when no default… Kubernetes-commit: afbe2935392ce36ada61b8dee2b08feab85d85b5
This commit is contained in:
commit
fe3cbcc1c0
|
@ -2638,19 +2638,10 @@ func (i *IngressDescriber) describeIngressV1(ing *networkingv1.Ingress, events *
|
|||
def := ing.Spec.DefaultBackend
|
||||
ns := ing.Namespace
|
||||
if def == nil {
|
||||
// Ingresses that don't specify a default backend inherit the
|
||||
// default backend in the kube-system namespace.
|
||||
def = &networkingv1.IngressBackend{
|
||||
Service: &networkingv1.IngressServiceBackend{
|
||||
Name: "default-http-backend",
|
||||
Port: networkingv1.ServiceBackendPort{
|
||||
Number: 80,
|
||||
},
|
||||
},
|
||||
}
|
||||
ns = metav1.NamespaceSystem
|
||||
}
|
||||
w.Write(LEVEL_0, "Default backend:\t<default>\n")
|
||||
} else {
|
||||
w.Write(LEVEL_0, "Default backend:\t%s\n", i.describeBackendV1(ns, def))
|
||||
}
|
||||
if len(ing.Spec.TLS) != 0 {
|
||||
describeIngressTLSV1(w, ing.Spec.TLS)
|
||||
}
|
||||
|
@ -2699,15 +2690,10 @@ func (i *IngressDescriber) describeIngressV1beta1(ing *networkingv1beta1.Ingress
|
|||
def := ing.Spec.Backend
|
||||
ns := ing.Namespace
|
||||
if def == nil {
|
||||
// Ingresses that don't specify a default backend inherit the
|
||||
// default backend in the kube-system namespace.
|
||||
def = &networkingv1beta1.IngressBackend{
|
||||
ServiceName: "default-http-backend",
|
||||
ServicePort: intstr.IntOrString{Type: intstr.Int, IntVal: 80},
|
||||
w.Write(LEVEL_0, "Default backend:\t<default>\n")
|
||||
} else {
|
||||
w.Write(LEVEL_0, "Default backend:\t%s\n", i.describeBackendV1beta1(ns, def))
|
||||
}
|
||||
ns = metav1.NamespaceSystem
|
||||
}
|
||||
w.Write(LEVEL_0, "Default backend:\t%s (%s)\n", backendStringer(def), i.describeBackendV1beta1(ns, def))
|
||||
if len(ing.Spec.TLS) != 0 {
|
||||
describeIngressTLSV1beta1(w, ing.Spec.TLS)
|
||||
}
|
||||
|
@ -2730,7 +2716,7 @@ func (i *IngressDescriber) describeIngressV1beta1(ing *networkingv1beta1.Ingress
|
|||
}
|
||||
}
|
||||
if count == 0 {
|
||||
w.Write(LEVEL_1, "%s\t%s \t%s (%s)\n", "*", "*", backendStringer(def), i.describeBackendV1beta1(ns, def))
|
||||
w.Write(LEVEL_1, "%s\t%s \t<default>\n", "*", "*")
|
||||
}
|
||||
printAnnotationsMultiline(w, "Annotations", ing.Annotations)
|
||||
|
||||
|
|
|
@ -2358,7 +2358,7 @@ Labels: id1=app1
|
|||
Namespace: foo
|
||||
Address:
|
||||
Ingress Class: test
|
||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
||||
Default backend: <default>
|
||||
Rules:
|
||||
Host Path Backends
|
||||
---- ---- --------
|
||||
|
@ -2374,7 +2374,7 @@ Labels: <none>
|
|||
Namespace: foo
|
||||
Address:
|
||||
Ingress Class: test
|
||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
||||
Default backend: <default>
|
||||
Rules:
|
||||
Host Path Backends
|
||||
---- ---- --------
|
||||
|
@ -2413,7 +2413,7 @@ Labels: <none>
|
|||
Namespace: foo
|
||||
Address:
|
||||
Ingress Class: test
|
||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
||||
Default backend: <default>
|
||||
Rules:
|
||||
Host Path Backends
|
||||
---- ---- --------
|
||||
|
@ -2452,7 +2452,7 @@ Labels: <none>
|
|||
Namespace: foo
|
||||
Address:
|
||||
Ingress Class: test
|
||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
||||
Default backend: <default>
|
||||
Rules:
|
||||
Host Path Backends
|
||||
---- ---- --------
|
||||
|
|
Loading…
Reference in New Issue