Skip to content

Commit

Permalink
core: continue and create an initial cluster info or fail
Browse files Browse the repository at this point in the history
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 <seb@redhat.com>
(cherry picked from commit e5ce6ab)
  • Loading branch information
leseb authored and mergify-bot committed Dec 8, 2021
1 parent cacea9b commit 05fae8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/operator/ceph/cluster/cluster.go
Expand Up @@ -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)
Expand Down

0 comments on commit 05fae8c

Please sign in to comment.