ceph: do not log an error if no clusters

If the list of cluster is empty there is no need to report an error in
the logs.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han committed 2020-08-05 10:05:51 +02:00
1 parent ec8e749ef5
commit af1e8c320a
1 file changed
+2 -2
@@ -58,11 +58,11 @@ func IsReadyToReconcile(c client.Client, clustercontext *clusterd.Context, names
clusterList := &cephv1.CephClusterList{}
err := c.List(context.TODO(), clusterList, client.InNamespace(namespacedName.Namespace))
if err != nil {
logger.Errorf("%q:failed to fetch CephCluster %v", controllerName, err)
logger.Errorf("%q: failed to fetch CephCluster %v", controllerName, err)
return cephCluster, false, cephClusterExists, ImmediateRetryResult
}
if len(clusterList.Items) == 0 {
logger.Errorf("%q: no CephCluster resource found in namespace %q", controllerName, namespacedName.Namespace)
logger.Debugf("%q: no CephCluster resource found in namespace %q", controllerName, namespacedName.Namespace)
return cephCluster, false, cephClusterExists, WaitForRequeueIfCephClusterNotReady
}
cephClusterExists = true