object: log all reconcile errors during object store creation

The object store controller was swallowing errors of the
type not found, assuming a certain category of errors
when ceph may still be initializing. But some of these
errors could be user error and they need to troubleshoot
the details of the error, so we need to log the specific
error instead of swallowing it.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
Travis Nielsen committed 2025-04-18 11:35:09 -06:00
1 parent df537124f9
commit 95a5920bef
1 file changed
+3 -1
+3 -1
View File
@@ -441,7 +441,9 @@ func (r *ReconcileCephObjectStore) reconcile(request reconcile.Request) (reconci
// CREATE/UPDATE
_, err = r.reconcileCreateObjectStore(cephObjectStore, request.NamespacedName, cephCluster.Spec)
if err != nil && kerrors.IsNotFound(err) {
logger.Info(opcontroller.OperatorNotInitializedMessage)
// A not found error may mean ceph is still initializing, but there might be some other error
// so we log the error and requeue
logger.Warningf("object store %q reconcile failed, ceph may still be initializing. %v", request.NamespacedName.String(), err)
return opcontroller.WaitForRequeueIfOperatorNotInitialized, *cephObjectStore, nil
} else if err != nil {
result, err := r.setFailedStatus(k8sutil.ObservedGenerationNotAvailable, request.NamespacedName, "failed to create object store deployments", err)