From e0b9ef931eccd572af8ff1f57dd03f8b761f6408 Mon Sep 17 00:00:00 2001 From: Stephen Greene Date: Tue, 11 May 2021 13:33:26 -0400 Subject: [PATCH] ingress: Fix up openshift-ingress namespace reconciliation Commit `ea085e7` added logic to reconcile the Ingress namespace during cluster upgrades. This follow-up commit fixes some mistakes introduced by that commit. pkg/operator/controller/ingress/namespace.go: Fix a typo: `opensift.io/cluster-monitoring`. We are, after all, in the computing business, and not the baking business. Check if annotation/label map values exist since comparing a non-existent map value to the empty string will always return true in this case. --- pkg/operator/controller/ingress/namespace.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/operator/controller/ingress/namespace.go b/pkg/operator/controller/ingress/namespace.go index df75d250c9..b50b0dfb43 100644 --- a/pkg/operator/controller/ingress/namespace.go +++ b/pkg/operator/controller/ingress/namespace.go @@ -86,7 +86,7 @@ func routerNamespaceChanged(current, expected *corev1.Namespace) (bool, *corev1. } knownLabels := []string{ - "opensift.io/cluster-monitoring", + "openshift.io/cluster-monitoring", "name", "network.openshift.io/policy-group", "policy-group.network.openshift.io/ingress", @@ -104,14 +104,14 @@ func routerNamespaceChanged(current, expected *corev1.Namespace) (bool, *corev1. } for _, annotation := range knownAnnotations { - if current.Annotations[annotation] != expected.Annotations[annotation] { + if val, ok := current.Annotations[annotation]; !ok || val != expected.Annotations[annotation] { updated.Annotations[annotation] = expected.Annotations[annotation] changed = true } } for _, label := range knownLabels { - if current.Labels[label] != expected.Labels[label] { + if val, ok := current.Labels[label]; !ok || val != expected.Labels[label] { updated.Labels[label] = expected.Labels[label] changed = true }