From d2564874ab4905a7944ddccb68c5dcbf8c475867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= Date: Wed, 24 May 2023 09:23:57 +0200 Subject: [PATCH] Fix panic when annotation of ingress is empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the annotation of ingress is not set, the returned value is nil (not empty map). Trying to assign to this map leads to panic. Signed-off-by: Jiří Pinkava --- pkg/router/util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/router/util.go b/pkg/router/util.go index ad0f6902f..fa4980692 100644 --- a/pkg/router/util.go +++ b/pkg/router/util.go @@ -29,6 +29,9 @@ func includeLabelsByPrefix(labels map[string]string, includeLabelPrefixes []stri } func filterMetadata(meta map[string]string) map[string]string { + if meta == nil { + meta = map[string]string{} + } // prevent Flux from overriding Flagger managed objects meta[toolkitReconcileKey] = toolkitReconcileValue meta[helmDriftDetectionKey] = toolkitReconcileValue