diff --git a/pkg/daemon/ceph/client/command.go b/pkg/daemon/ceph/client/command.go index 5c4e761da..ffc38fd02 100644 --- a/pkg/daemon/ceph/client/command.go +++ b/pkg/daemon/ceph/client/command.go @@ -253,23 +253,15 @@ func ExecuteRBDCommandWithTimeout(context *clusterd.Context, args []string) (str func ExecuteCephCommandWithRetry( cmd func() (string, []byte, error), - getExitCode func(err error) (int, bool), retries int, - retryOnExitCode int, waitTime time.Duration, ) ([]byte, error) { for i := 0; i < retries; i++ { action, data, err := cmd() if err != nil { - exitCode, parsed := getExitCode(err) - if parsed { - if exitCode == retryOnExitCode { - logger.Infof("command failed for %s. trying again...", action) - time.Sleep(waitTime) - continue - } - } - return nil, errors.Wrapf(err, "failed to complete command for %s", action) + logger.Infof("command failed for %s. trying again...", action) + time.Sleep(waitTime) + continue } if i > 0 { logger.Infof("action %s succeeded on attempt %d", action, i) diff --git a/pkg/operator/ceph/cluster/mgr/dashboard.go b/pkg/operator/ceph/cluster/mgr/dashboard.go index 7f0d68977..2fa57dd6d 100644 --- a/pkg/operator/ceph/cluster/mgr/dashboard.go +++ b/pkg/operator/ceph/cluster/mgr/dashboard.go @@ -230,7 +230,7 @@ func (c *Cluster) setLoginCredentials(password string) error { _, err = client.ExecuteCephCommandWithRetry(func() (string, []byte, error) { output, err := client.NewCephCommand(c.context, c.clusterInfo, args).RunWithTimeout(exec.CephCommandsTimeout) return "set dashboard creds", output, err - }, c.exitCode, 5, invalidArgErrorCode, dashboardInitWaitTime) + }, 5, dashboardInitWaitTime) if err != nil { return errors.Wrap(err, "failed to set login creds on mgr") } diff --git a/pkg/operator/ceph/cluster/mgr/orchestrator.go b/pkg/operator/ceph/cluster/mgr/orchestrator.go index 6a8a83d90..366e7e442 100644 --- a/pkg/operator/ceph/cluster/mgr/orchestrator.go +++ b/pkg/operator/ceph/cluster/mgr/orchestrator.go @@ -50,7 +50,7 @@ func (c *Cluster) setRookOrchestratorBackend() error { args := []string{"orch", "set", "backend", "rook"} output, err := client.NewCephCommand(c.context, c.clusterInfo, args).RunWithTimeout(exec.CephCommandsTimeout) return "set rook backend", output, err - }, c.exitCode, 5, invalidArgErrorCode, orchestratorInitWaitTime) + }, 5, orchestratorInitWaitTime) if err != nil { return errors.Wrap(err, "failed to set rook as the orchestrator backend") }