Skip to content

Commit

Permalink
Fix panic when annotation of ingress is empty
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pinkavaj committed May 29, 2023
1 parent e71ce18 commit d256487
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/router/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d256487

Please sign in to comment.