mirror of
https://github.com/prometheus/prometheus
synced 2025-01-11 08:59:37 +00:00
Don't set label if ingressClassName is not set
Signed-off-by: Mike Eves <michael.eves@autotrader.co.uk>
This commit is contained in:
parent
7e1111ff14
commit
7941b350ba
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user