From d9206d8fb8aab0bbc3a206ca507836adbbd4afc5 Mon Sep 17 00:00:00 2001 From: amecea Date: Tue, 14 May 2019 16:43:39 +0300 Subject: [PATCH] Initialize annotations map before use --- pkg/controller/node/node_controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/controller/node/node_controller.go b/pkg/controller/node/node_controller.go index c5198e7de..b05a2ff94 100644 --- a/pkg/controller/node/node_controller.go +++ b/pkg/controller/node/node_controller.go @@ -173,6 +173,9 @@ func (r *ReconcileMysqlNode) Reconcile(request reconcile.Request) (reconcile.Res if shouldUpdateToVersion(cluster, 300) { // if the cluster is upgraded then set on the cluster an annotations that skips the GTID configuration // TODO: this should be removed in the next versions + if cluster.Annotations == nil { + cluster.Annotations = make(map[string]string) + } cluster.Annotations["mysql.presslabs.org/SkipGTIDPurged"] = "true" return reconcile.Result{}, r.Update(ctx, cluster.Unwrap()) }