Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(platform):add new cluster phase ClusterRecovering #2320

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/platform/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ const (
ClusterUpscaling ClusterPhase = "Upscaling"
// ClusterDownscaling means the cluster is undergoing graceful down scaling.
ClusterDownscaling ClusterPhase = "Downscaling"
// ClusterRecovering means the cluster is recovering form confined.
ClusterRecovering ClusterPhase = "Recovering"
)

// ComponentPhase defines the phase of anywhere cluster component
Expand Down
2 changes: 2 additions & 0 deletions api/platform/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ const (
ClusterUpscaling ClusterPhase = "Upscaling"
// ClusterDownscaling means the cluster is undergoing graceful down scaling.
ClusterDownscaling ClusterPhase = "Downscaling"
// ClusterRecovering means the cluster is recovering form confined.
ClusterRecovering ClusterPhase = "Recovering"
)

// ComponentPhase defines the phase of anywhere cluster component
Expand Down
5 changes: 3 additions & 2 deletions pkg/platform/controller/cluster/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (c *Controller) reconcile(ctx context.Context, key string, cluster *platfor
err = c.onUpdate(ctx, cluster)
case platformv1.ClusterUpscaling, platformv1.ClusterDownscaling:
err = c.onUpdate(ctx, cluster)
case platformv1.ClusterIdling, platformv1.ClusterConfined:
case platformv1.ClusterIdling, platformv1.ClusterConfined, platformv1.ClusterRecovering:
err = c.onUpdate(ctx, cluster)
case platformv1.ClusterTerminating:
log.FromContext(ctx).Info("Cluster has been terminated. Attempting to cleanup resources")
Expand Down Expand Up @@ -444,7 +444,8 @@ func (c *Controller) onUpdate(ctx context.Context, cluster *platformv1.Cluster)
if clusterWrapper.Status.Phase == platformv1.ClusterRunning ||
clusterWrapper.Status.Phase == platformv1.ClusterFailed ||
clusterWrapper.Status.Phase == platformv1.ClusterIdling ||
clusterWrapper.Status.Phase == platformv1.ClusterConfined {
clusterWrapper.Status.Phase == platformv1.ClusterConfined ||
clusterWrapper.Status.Phase == platformv1.ClusterRecovering {
err = provider.OnUpdate(ctx, clusterWrapper)
clusterWrapper = c.checkHealth(ctx, clusterWrapper)
if err != nil {
Expand Down
Loading