ceph: silence harmless error

Let's skip the reconcile and back-off if the operator is not ready.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han committed 2021-02-22 14:39:32 +01:00
1 parent 7404de7b38
commit 288b0f6439
1 file changed
+5
@@ -20,6 +20,7 @@ import (
"context"
"fmt"
"reflect"
"strings"
"github.com/coreos/pkg/capnslog"
"github.com/pkg/errors"
@@ -195,6 +196,10 @@ func (r *ReconcileFilesystemMirror) reconcile(request reconcile.Request) (reconc
daemon := string(opconfig.MonType)
currentCephVersion, err := cephclient.LeastUptodateDaemonVersion(r.context, r.clusterInfo, daemon)
if err != nil {
if strings.Contains(err.Error(), opcontroller.UninitializedCephConfigError) {
logger.Info("skipping reconcile since operator is still initializing")
return opcontroller.WaitForRequeueIfOperatorNotInitialized, nil
}
return opcontroller.ImmediateRetryResult, errors.Wrapf(err, "failed to retrieve current ceph %q version", daemon)
}
// Validate Ceph version