From 7941b350ba1b03b92defcf4cf828bcabec27d414 Mon Sep 17 00:00:00 2001 From: Mike Eves Date: Fri, 11 Jun 2021 15:14:23 +0100 Subject: [PATCH] Don't set label if ingressClassName is not set Signed-off-by: Mike Eves --- discovery/kubernetes/ingress.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/discovery/kubernetes/ingress.go b/discovery/kubernetes/ingress.go index 68b4797ed..c09fb7090 100644 --- a/discovery/kubernetes/ingress.go +++ b/discovery/kubernetes/ingress.go @@ -155,9 +155,7 @@ func ingressLabels(ingress *v1beta1.Ingress) model.LabelSet { ls := make(model.LabelSet, 2*(len(ingress.Labels)+len(ingress.Annotations))+2) ls[ingressNameLabel] = lv(ingress.Name) ls[namespaceLabel] = lv(ingress.Namespace) - if ingress.Spec.IngressClassName == nil { - ls[ingressClassNameLabel] = lv("") - } else { + if ingress.Spec.IngressClassName != nil { ls[ingressClassNameLabel] = lv(*ingress.Spec.IngressClassName) }