From 05fae8c22e14acc872d1eb504bafcd71a9119ccd 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 (cherry picked from commit e5ce6abac0b8d944752bba76daa4869d424d7b3f) --- 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 0c4bab321b4eb..d340c192dada7 100755 --- a/pkg/operator/ceph/cluster/cluster.go +++ b/pkg/operator/ceph/cluster/cluster.go @@ -182,7 +182,11 @@ func (c *ClusterController) initializeCluster(cluster *cluster) error { clusterInfo, _, _, err := mon.LoadClusterInfo(c.context, 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)