Skip to content

Commit

Permalink
Added handling of failed states when waiting for cluster status.
Browse files Browse the repository at this point in the history
  • Loading branch information
brett19 committed Sep 10, 2024
1 parent d5b21e8 commit d80ee90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/capellacontrol/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package capellacontrol
import (
"context"
"fmt"
"strings"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -71,6 +72,10 @@ func (m *Manager) WaitForClusterState(
return fmt.Errorf("cluster disappeared during wait for '%s' state", desiredState)
}

if strings.Contains(clusterStatus, "failed") {
return fmt.Errorf("cancelling as cluster is in a failed state ('%s')", clusterStatus)
}

m.Logger.Info("waiting for cluster status...",
zap.String("current", clusterStatus),
zap.String("desired", desiredState))
Expand Down

0 comments on commit d80ee90

Please sign in to comment.