Skip to content

Commit d9206d8

Browse files
committed
Initialize annotations map before use
1 parent 80e8f35 commit d9206d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/node/node_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ func (r *ReconcileMysqlNode) Reconcile(request reconcile.Request) (reconcile.Res
173173
if shouldUpdateToVersion(cluster, 300) {
174174
// if the cluster is upgraded then set on the cluster an annotations that skips the GTID configuration
175175
// TODO: this should be removed in the next versions
176+
if cluster.Annotations == nil {
177+
cluster.Annotations = make(map[string]string)
178+
}
176179
cluster.Annotations["mysql.presslabs.org/SkipGTIDPurged"] = "true"
177180
return reconcile.Result{}, r.Update(ctx, cluster.Unwrap())
178181
}

0 commit comments

Comments
 (0)