Skip to content

Commit d256487

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 d256487

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/router/util.go

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

3131
func filterMetadata(meta map[string]string) map[string]string {
32+
if meta == nil {
33+
meta = map[string]string{}
34+
}
3235
// prevent Flux from overriding Flagger managed objects
3336
meta[toolkitReconcileKey] = toolkitReconcileValue
3437
meta[helmDriftDetectionKey] = toolkitReconcileValue

0 commit comments

Comments
 (0)