Skip to content

Commit

Permalink
updated multiclusterengine phase status when the operator is paused (#…
Browse files Browse the repository at this point in the history
…555)

Signed-off-by: Disaiah Bennett <[email protected]>
  • Loading branch information
dislbenn authored Dec 13, 2023
1 parent 7a26a7d commit 4b54372
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/v1/multiclusterengine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ type PhaseType string

const (
MultiClusterEnginePhaseProgressing PhaseType = "Progressing"
MultiClusterEnginePhasePaused PhaseType = "Paused"
MultiClusterEnginePhaseAvailable PhaseType = "Available"
MultiClusterEnginePhaseUninstalling PhaseType = "Uninstalling"
MultiClusterEnginePhaseError PhaseType = "Error"
Expand Down
6 changes: 6 additions & 0 deletions pkg/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func (sm *StatusTracker) reportConditions() []bpv1.MultiClusterEngineCondition {
func (sm *StatusTracker) reportPhase(mce bpv1.MultiClusterEngine, components []bpv1.ComponentCondition, conditions []bpv1.MultiClusterEngineCondition) bpv1.PhaseType {
progress := getCondition(conditions, bpv1.MultiClusterEngineProgressing)

for _, condition := range conditions {
if condition.Reason == PausedReason {
return bpv1.MultiClusterEnginePhasePaused
}
}

// If operator isn't progressing show error phase
if progress != nil && progress.Status == metav1.ConditionFalse {
return bpv1.MultiClusterEnginePhaseError
Expand Down

0 comments on commit 4b54372

Please sign in to comment.