mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Specify empty IngresClassName as <none> to more clearly specify it is empty
This commit is contained in:
parent
8b541910c0
commit
e7e2bfde16
@ -2630,7 +2630,7 @@ func (i *IngressDescriber) describeIngressV1(ing *networkingv1.Ingress, events *
|
||||
printLabelsMultiline(w, "Labels", ing.Labels)
|
||||
w.Write(LEVEL_0, "Namespace:\t%v\n", ing.Namespace)
|
||||
w.Write(LEVEL_0, "Address:\t%v\n", loadBalancerStatusStringer(ing.Status.LoadBalancer, true))
|
||||
ingressClassName := ""
|
||||
ingressClassName := "<none>"
|
||||
if ing.Spec.IngressClassName != nil {
|
||||
ingressClassName = *ing.Spec.IngressClassName
|
||||
}
|
||||
@ -2691,7 +2691,7 @@ func (i *IngressDescriber) describeIngressV1beta1(ing *networkingv1beta1.Ingress
|
||||
printLabelsMultiline(w, "Labels", ing.Labels)
|
||||
w.Write(LEVEL_0, "Namespace:\t%v\n", ing.Namespace)
|
||||
w.Write(LEVEL_0, "Address:\t%v\n", loadBalancerStatusStringer(ing.Status.LoadBalancer, true))
|
||||
ingressClassName := ""
|
||||
ingressClassName := "<none>"
|
||||
if ing.Spec.IngressClassName != nil {
|
||||
ingressClassName = *ing.Spec.IngressClassName
|
||||
}
|
||||
|
@ -2604,6 +2604,30 @@ Rules:
|
||||
* * default-backend:80 (<error: endpoints "default-backend" not found>)
|
||||
Annotations: <none>
|
||||
Events: <none>
|
||||
`,
|
||||
},
|
||||
"EmptyIngressClassName": {
|
||||
input: fake.NewSimpleClientset(&networkingv1.Ingress{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "bar",
|
||||
Namespace: "foo",
|
||||
},
|
||||
Spec: networkingv1.IngressSpec{
|
||||
DefaultBackend: &backendV1,
|
||||
},
|
||||
}),
|
||||
output: `Name: bar
|
||||
Labels: <none>
|
||||
Namespace: foo
|
||||
Address:
|
||||
Ingress Class: <none>
|
||||
Default backend: default-backend:80 (<error: endpoints "default-backend" not found>)
|
||||
Rules:
|
||||
Host Path Backends
|
||||
---- ---- --------
|
||||
* * default-backend:80 (<error: endpoints "default-backend" not found>)
|
||||
Annotations: <none>
|
||||
Events: <none>
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user