From 8c560cd23b04ba10b4a9bf9af5a4d06c0115919f Mon Sep 17 00:00:00 2001 From: Xin Li Date: Wed, 9 Nov 2022 09:38:34 +0800 Subject: [PATCH] feat(platform): add new cluster phase waiting (#2157) Signed-off-by: danielxxli Signed-off-by: danielxxli --- api/platform/types.go | 2 ++ api/platform/v1/types.go | 2 ++ pkg/platform/controller/cluster/cluster_controller.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/platform/types.go b/api/platform/types.go index c9a4b62a4..5799f2b76 100644 --- a/api/platform/types.go +++ b/api/platform/types.go @@ -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. diff --git a/api/platform/v1/types.go b/api/platform/v1/types.go index e258e1478..fce294d3f 100644 --- a/api/platform/v1/types.go +++ b/api/platform/v1/types.go @@ -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. diff --git a/pkg/platform/controller/cluster/cluster_controller.go b/pkg/platform/controller/cluster/cluster_controller.go index 126e2696f..7d5c5ef77 100644 --- a/pkg/platform/controller/cluster/cluster_controller.go +++ b/pkg/platform/controller/cluster/cluster_controller.go @@ -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)