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
|
def := ing.Spec.DefaultBackend
|
||||||
ns := ing.Namespace
|
ns := ing.Namespace
|
||||||
if def == nil {
|
if def == nil {
|
||||||
// Ingresses that don't specify a default backend inherit the
|
w.Write(LEVEL_0, "Default backend:\t<default>\n")
|
||||||
// default backend in the kube-system namespace.
|
} else {
|
||||||
def = &networkingv1.IngressBackend{
|
w.Write(LEVEL_0, "Default backend:\t%s\n", i.describeBackendV1(ns, def))
|
||||||
Service: &networkingv1.IngressServiceBackend{
|
|
||||||
Name: "default-http-backend",
|
|
||||||
Port: networkingv1.ServiceBackendPort{
|
|
||||||
Number: 80,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
ns = metav1.NamespaceSystem
|
|
||||||
}
|
}
|
||||||
w.Write(LEVEL_0, "Default backend:\t%s\n", i.describeBackendV1(ns, def))
|
|
||||||
if len(ing.Spec.TLS) != 0 {
|
if len(ing.Spec.TLS) != 0 {
|
||||||
describeIngressTLSV1(w, ing.Spec.TLS)
|
describeIngressTLSV1(w, ing.Spec.TLS)
|
||||||
}
|
}
|
||||||
|
@ -2699,15 +2690,10 @@ func (i *IngressDescriber) describeIngressV1beta1(ing *networkingv1beta1.Ingress
|
||||||
def := ing.Spec.Backend
|
def := ing.Spec.Backend
|
||||||
ns := ing.Namespace
|
ns := ing.Namespace
|
||||||
if def == nil {
|
if def == nil {
|
||||||
// Ingresses that don't specify a default backend inherit the
|
w.Write(LEVEL_0, "Default backend:\t<default>\n")
|
||||||
// default backend in the kube-system namespace.
|
} else {
|
||||||
def = &networkingv1beta1.IngressBackend{
|
w.Write(LEVEL_0, "Default backend:\t%s\n", i.describeBackendV1beta1(ns, def))
|
||||||
ServiceName: "default-http-backend",
|
|
||||||
ServicePort: intstr.IntOrString{Type: intstr.Int, IntVal: 80},
|
|
||||||
}
|
|
||||||
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 {
|
if len(ing.Spec.TLS) != 0 {
|
||||||
describeIngressTLSV1beta1(w, ing.Spec.TLS)
|
describeIngressTLSV1beta1(w, ing.Spec.TLS)
|
||||||
}
|
}
|
||||||
|
@ -2730,7 +2716,7 @@ func (i *IngressDescriber) describeIngressV1beta1(ing *networkingv1beta1.Ingress
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if count == 0 {
|
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)
|
printAnnotationsMultiline(w, "Annotations", ing.Annotations)
|
||||||
|
|
||||||
|
|
|
@ -2358,7 +2358,7 @@ Labels: id1=app1
|
||||||
Namespace: foo
|
Namespace: foo
|
||||||
Address:
|
Address:
|
||||||
Ingress Class: test
|
Ingress Class: test
|
||||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
Default backend: <default>
|
||||||
Rules:
|
Rules:
|
||||||
Host Path Backends
|
Host Path Backends
|
||||||
---- ---- --------
|
---- ---- --------
|
||||||
|
@ -2374,7 +2374,7 @@ Labels: <none>
|
||||||
Namespace: foo
|
Namespace: foo
|
||||||
Address:
|
Address:
|
||||||
Ingress Class: test
|
Ingress Class: test
|
||||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
Default backend: <default>
|
||||||
Rules:
|
Rules:
|
||||||
Host Path Backends
|
Host Path Backends
|
||||||
---- ---- --------
|
---- ---- --------
|
||||||
|
@ -2413,7 +2413,7 @@ Labels: <none>
|
||||||
Namespace: foo
|
Namespace: foo
|
||||||
Address:
|
Address:
|
||||||
Ingress Class: test
|
Ingress Class: test
|
||||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
Default backend: <default>
|
||||||
Rules:
|
Rules:
|
||||||
Host Path Backends
|
Host Path Backends
|
||||||
---- ---- --------
|
---- ---- --------
|
||||||
|
@ -2452,7 +2452,7 @@ Labels: <none>
|
||||||
Namespace: foo
|
Namespace: foo
|
||||||
Address:
|
Address:
|
||||||
Ingress Class: test
|
Ingress Class: test
|
||||||
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
|
Default backend: <default>
|
||||||
Rules:
|
Rules:
|
||||||
Host Path Backends
|
Host Path Backends
|
||||||
---- ---- --------
|
---- ---- --------
|
||||||
|
|
Loading…
Reference in New Issue