From afeb38417d9b651921da69921496b9a95d823f39 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Thu, 7 Jan 2021 17:24:13 -0700 Subject: [PATCH] ceph: suppress reconcile error after operator restart After the operator restarts, the controllers will not all be able to reconcile until the ceph config has been generated by the reconcile of the CephCluster controller. The message printed to the operator log is frequently seen as an error condition even though it is a normal condition where we requeue the reconcile until the config is available. Signed-off-by: Travis Nielsen --- pkg/operator/ceph/controller/controller_utils.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/controller/controller_utils.go b/pkg/operator/ceph/controller/controller_utils.go index 752034976..d15d8261a 100644 --- a/pkg/operator/ceph/controller/controller_utils.go +++ b/pkg/operator/ceph/controller/controller_utils.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "reflect" + "strings" "time" cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1" @@ -111,7 +112,13 @@ func IsReadyToReconcile(c client.Client, clustercontext *clusterd.Context, names return cephCluster, true, cephClusterExists, WaitForRequeueIfCephClusterNotReady } - logger.Infof("%s: CephCluster %q found but skipping reconcile since ceph health is %q", controllerName, cephCluster.Name, cephCluster.Status.CephStatus) + details := cephCluster.Status.CephStatus.Details + message, ok := details["error"] + if ok && len(details) == 1 && strings.Contains(message.Message, "Error initializing cluster client") { + logger.Infof("%s: skipping reconcile since operator is still initializing", controllerName) + } else { + logger.Infof("%s: CephCluster %q found but skipping reconcile since ceph health is %q", controllerName, cephCluster.Name, cephCluster.Status.CephStatus) + } } return cephCluster, false, cephClusterExists, WaitForRequeueIfCephClusterNotReady