From 8cd09ecd39e73255311eefe3e35484982e6eeeb9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 16 Nov 2023 18:53:34 +0100 Subject: [PATCH] mgr: honor the ContinueUpgradeAfterChecksEvenIfNotHealthy flag Fixes: #13167 Previously, the mgr did not honor the flag ContinueUpgradeAfterChecksEvenIfNotHealthy from the cluster spec. Only osd, mds, and rgw did. To render the update behavior correct and complete across the daemons, this change implements the honoring of the flag for the mgr. Signed-off-by: Michael Adam (cherry picked from commit 93bf6540b245c4cf191835c91fccdc79903efe4b) --- pkg/operator/ceph/cluster/mgr/mgr.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/operator/ceph/cluster/mgr/mgr.go b/pkg/operator/ceph/cluster/mgr/mgr.go index aa55ef0de..6eab5f03f 100644 --- a/pkg/operator/ceph/cluster/mgr/mgr.go +++ b/pkg/operator/ceph/cluster/mgr/mgr.go @@ -150,9 +150,14 @@ func (c *Cluster) Start() error { return errors.Wrapf(err, "failed to create mgr deployment %s", resourceName) } logger.Infof("deployment for mgr %s already exists. updating if needed", resourceName) - - if err := updateDeploymentAndWait(c.context, c.clusterInfo, d, config.MgrType, mgrConfig.DaemonID, c.spec.SkipUpgradeChecks, false); err != nil { + if err := updateDeploymentAndWait(c.context, c.clusterInfo, d, config.MgrType, mgrConfig.DaemonID, c.spec.SkipUpgradeChecks, c.spec.ContinueUpgradeAfterChecksEvenIfNotHealthy); err != nil { logger.Errorf("failed to update mgr deployment %q. %v", resourceName, err) + if c.spec.ContinueUpgradeAfterChecksEvenIfNotHealthy { + logger.Infof("continuing reconcile of ceph cluster in namespace %s after error waiting for mgr because continueUpgradeAfterChecksEvenIfNotHealthy is true", c.clusterInfo.Namespace) + } else { + logger.Infof("stopping reconcile of ceph cluster in namespace %s after error waiting for mgr because continueUpgradeAfterChecksEvenIfNotHealthy is false", c.clusterInfo.Namespace) + return errors.Wrapf(err, "failed to update mgr deployment %q", resourceName) + } } } else { // wait for the new deployment