From e5ce6abac0b8d944752bba76daa4869d424d7b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 8 Dec 2021 17:31:44 +0100 Subject: [PATCH] core: continue and create an initial cluster info or fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's catch the correct error when no cluster info exists yet. If we have another error, we fail the orchestration and try again. This could help up catching small API hiccups for example. Signed-off-by: Sébastien Han --- pkg/operator/ceph/cluster/cluster.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/cluster/cluster.go b/pkg/operator/ceph/cluster/cluster.go index 3970e6763941..7ba602234d7b 100755 --- a/pkg/operator/ceph/cluster/cluster.go +++ b/pkg/operator/ceph/cluster/cluster.go @@ -168,7 +168,11 @@ func (c *ClusterController) initializeCluster(cluster *cluster) error { clusterInfo, _, _, err := mon.LoadClusterInfo(c.context, c.OpManagerCtx, cluster.Namespace) if err != nil { - logger.Infof("clusterInfo not yet found, must be a new cluster") + if errors.Is(err, mon.ClusterInfoNoClusterNoSecret) { + logger.Info("clusterInfo not yet found, must be a new cluster.") + } else { + return errors.Wrap(err, "failed to load cluster info") + } } else { clusterInfo.OwnerInfo = cluster.ownerInfo clusterInfo.SetName(c.namespacedName.Name)