From 99c40d4887a77cbaf8b7b83ab1e6bd570bc316f1 Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Thu, 5 Nov 2020 16:35:47 +0700 Subject: [PATCH] cluster_controller: shift log error on cluster update to info level When scylla-operator is bringing cluster up on GKE it can raise "Failed to update cluster status, Operation cannot be fulfilled on" This PR is to log this under INFO log level Fixes #217 --- pkg/controllers/cluster/cluster_controller.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/cluster/cluster_controller.go b/pkg/controllers/cluster/cluster_controller.go index 87355d172e..e9d4022529 100644 --- a/pkg/controllers/cluster/cluster_controller.go +++ b/pkg/controllers/cluster/cluster_controller.go @@ -121,7 +121,11 @@ func (cc *ClusterReconciler) Reconcile(request ctrl.Request) (ctrl.Result, error if !reflect.DeepEqual(c.Status, copy.Status) { logger.Info(ctx, "Writing cluster status.") if err := cc.Status().Update(ctx, copy); err != nil { - logger.Error(ctx, "Failed to update cluster status", "error", err) + if apierrors.IsConflict(err) { + logger.Info(ctx, "Failed to update cluster status", "error", err) + } else { + logger.Error(ctx, "Failed to update cluster status", "error", err) + } return reconcile.Result{}, errors.WithStack(err) } }