Merge pull request #15644 from rook/mergify/bp/release-1.17/pr-15636

operator: decouple mon and mgr post-startup operations (backport #15636)
This commit is contained in:
Travis Nielsen authored and GitHub committed 2025-04-04 02:34:42 -06:00
commit a4e86ce655
2 files changed
+15 -6

No files matched your search

+14 -5
View File
@@ -144,6 +144,13 @@ func (c *cluster) reconcileCephDaemons(rookImage string, cephVersion cephver.Cep
return errors.Wrap(err, "failed to start ceph mgr")
}
// Execute actions after the managers are up and running
logger.Debug("managers are up and running, executing post actions")
err = c.postMgrStartupActions()
if err != nil {
return errors.Wrap(err, "failed to execute post actions after all the ceph managers started")
}
// Start the OSDs
controller.UpdateCondition(c.ClusterInfo.Context, c.context, c.namespacedName, k8sutil.ObservedGenerationNotAvailable, cephv1.ConditionProgressing, v1.ConditionTrue, cephv1.ClusterProgressingReason, "Configuring Ceph OSDs")
osds := osd.New(c.context, c.ClusterInfo, *c.Spec, rookImage)
@@ -470,11 +477,6 @@ func (c *cluster) postMonStartupActions() error {
return errors.Wrap(err, "failed to configure msgr2")
}
// Set config store options
if err := c.updateConfigStoreFromCRD(); err != nil {
return errors.Wrap(err, "")
}
if err := c.configureStorageSettings(); err != nil {
return errors.Wrap(err, "failed to configure storage settings")
}
@@ -497,6 +499,13 @@ func (c *cluster) postMonStartupActions() error {
return nil
}
func (c *cluster) postMgrStartupActions() error {
if err := c.updateConfigStoreFromCRD(); err != nil {
return errors.Wrap(err, "failed to set config store options")
}
return nil
}
func (c *cluster) configureStorageSettings() error {
if !c.shouldSetClusterFullSettings() {
return nil
@@ -31,7 +31,7 @@ const (
var orchestratorInitWaitTime = 5 * time.Second
// Ceph docs about the orchestrator modules: http://docs.ceph.com/docs/master/mgr/orchestrator_cli/
// Ceph docs about the orchestrator modules: https://docs.ceph.com/en/latest/mgr/orchestrator/
func (c *Cluster) configureOrchestratorModules() error {
if err := client.MgrEnableModule(c.context, c.clusterInfo, rookModuleName, true); err != nil {
return errors.Wrap(err, "failed to enable mgr rook module")