Skip to content

Commit

Permalink
feat(platform): add new cluster phase waiting (#2157)
Browse files Browse the repository at this point in the history
Signed-off-by: danielxxli <danielxxli@tencent.com>

Signed-off-by: danielxxli <danielxxli@tencent.com>
  • Loading branch information
DanielXLee authored Nov 9, 2022
1 parent f42cc9a commit 8c560cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/platform/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ type ClusterPhase string
const (
// ClusterInitializing is the initialize phase.
ClusterInitializing ClusterPhase = "Initializing"
// ClusterWaiting indicates that the cluster is waiting for registration.
ClusterWaiting ClusterPhase = "Waiting"
// ClusterRunning is the normal running phase.
ClusterRunning ClusterPhase = "Running"
// ClusterFailed is the failed phase.
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 @@ -319,6 +319,8 @@ type ClusterPhase string
const (
// ClusterInitializing is the initialize phase.
ClusterInitializing ClusterPhase = "Initializing"
// ClusterWaiting indicates that the cluster is waiting for registration.
ClusterWaiting ClusterPhase = "Waiting"
// ClusterRunning is the normal running phase.
ClusterRunning ClusterPhase = "Running"
// ClusterFailed is the failed phase.
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/controller/cluster/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (c *Controller) reconcile(ctx context.Context, key string, cluster *platfor
case "":
cluster.Status.Phase = platformv1.ClusterInitializing
err = c.onCreate(ctx, cluster)
case platformv1.ClusterInitializing:
case platformv1.ClusterInitializing, platformv1.ClusterWaiting:
err = c.onCreate(ctx, cluster)
case platformv1.ClusterRunning, platformv1.ClusterFailed:
err = c.onUpdate(ctx, cluster)
Expand Down

0 comments on commit 8c560cd

Please sign in to comment.