Skip to content

Commit a1d0ed0

Browse files
committed
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 <[email protected]>
1 parent e71ce18 commit a1d0ed0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/router/util.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ func includeLabelsByPrefix(labels map[string]string, includeLabelPrefixes []stri
2929
}
3030

3131
func filterMetadata(meta map[string]string) map[string]string {
32-
// prevent Flux from overriding Flagger managed objects
33-
meta[toolkitReconcileKey] = toolkitReconcileValue
34-
meta[helmDriftDetectionKey] = toolkitReconcileValue
32+
if meta != nil {
33+
// prevent Flux from overriding Flagger managed objects
34+
meta[toolkitReconcileKey] = toolkitReconcileValue
35+
meta[helmDriftDetectionKey] = toolkitReconcileValue
36+
}
3537
return meta
3638
}

0 commit comments

Comments
 (0)