Skip to content

Commit 08d29b9

Browse files
authored
Merge branch 'master' into feat_track_prev_matched_grafanas
2 parents 7b286ec + 856491c commit 08d29b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

controllers/controller_shared.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ func patchFinalizers(ctx context.Context, cl client.Client, cr client.Object) er
519519
func addAnnotation(ctx context.Context, cl client.Client, cr client.Object, key string, value string) error {
520520
crAnnotations := cr.GetAnnotations()
521521

522+
if crAnnotations == nil {
523+
crAnnotations = make(map[string]string, 0)
524+
}
525+
522526
if crAnnotations[key] == value {
523527
return nil
524528
}

0 commit comments

Comments
 (0)