Skip to content

Commit 3adc0f4

Browse files
1996wentaozhangwtaozzhang
and
wtaozzhang
authored
feat: add new cluster phase ClusterRecovering (#2320)
Co-authored-by: wtaozzhang <[email protected]>
1 parent e0e2b8b commit 3adc0f4

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

api/platform/types.go

+2
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ const (
330330
ClusterUpscaling ClusterPhase = "Upscaling"
331331
// ClusterDownscaling means the cluster is undergoing graceful down scaling.
332332
ClusterDownscaling ClusterPhase = "Downscaling"
333+
// ClusterRecovering means the cluster is recovering form confined.
334+
ClusterRecovering ClusterPhase = "Recovering"
333335
)
334336

335337
// ComponentPhase defines the phase of anywhere cluster component

api/platform/v1/types.go

+2
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ const (
345345
ClusterUpscaling ClusterPhase = "Upscaling"
346346
// ClusterDownscaling means the cluster is undergoing graceful down scaling.
347347
ClusterDownscaling ClusterPhase = "Downscaling"
348+
// ClusterRecovering means the cluster is recovering form confined.
349+
ClusterRecovering ClusterPhase = "Recovering"
348350
)
349351

350352
// ComponentPhase defines the phase of anywhere cluster component

pkg/platform/controller/cluster/cluster_controller.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func (c *Controller) reconcile(ctx context.Context, key string, cluster *platfor
358358
err = c.onUpdate(ctx, cluster)
359359
case platformv1.ClusterUpscaling, platformv1.ClusterDownscaling:
360360
err = c.onUpdate(ctx, cluster)
361-
case platformv1.ClusterIdling, platformv1.ClusterConfined:
361+
case platformv1.ClusterIdling, platformv1.ClusterConfined, platformv1.ClusterRecovering:
362362
err = c.onUpdate(ctx, cluster)
363363
case platformv1.ClusterTerminating:
364364
log.FromContext(ctx).Info("Cluster has been terminated. Attempting to cleanup resources")
@@ -444,7 +444,8 @@ func (c *Controller) onUpdate(ctx context.Context, cluster *platformv1.Cluster)
444444
if clusterWrapper.Status.Phase == platformv1.ClusterRunning ||
445445
clusterWrapper.Status.Phase == platformv1.ClusterFailed ||
446446
clusterWrapper.Status.Phase == platformv1.ClusterIdling ||
447-
clusterWrapper.Status.Phase == platformv1.ClusterConfined {
447+
clusterWrapper.Status.Phase == platformv1.ClusterConfined ||
448+
clusterWrapper.Status.Phase == platformv1.ClusterRecovering {
448449
err = provider.OnUpdate(ctx, clusterWrapper)
449450
clusterWrapper = c.checkHealth(ctx, clusterWrapper)
450451
if err != nil {

0 commit comments

Comments
 (0)