Fix panic when annotation of ingress is empty

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 <j-pi@seznam.cz>
This commit is contained in:
Jiří Pinkava
2023-05-29 11:27:28 +02:00
parent e71ce18b9d
commit d2564874ab
+3
View File
@@ -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