From 2ed52548b46bb436d973b63694cdee83b8808863 Mon Sep 17 00:00:00 2001 From: Y-Rookie Date: Mon, 6 Jan 2025 11:21:45 +0800 Subject: [PATCH] set podService default false --- apis/apps/v1/cluster_types.go | 1 + apis/apps/v1alpha1/cluster_types.go | 1 + config/crd/bases/apps.kubeblocks.io_clusters.yaml | 4 ++++ .../crd/bases/operations.kubeblocks.io_opsrequests.yaml | 1 + controllers/apps/transformer_cluster_component.go | 8 ++++++++ deploy/helm/crds/apps.kubeblocks.io_clusters.yaml | 4 ++++ .../helm/crds/operations.kubeblocks.io_opsrequests.yaml | 1 + 7 files changed, 20 insertions(+) diff --git a/apis/apps/v1/cluster_types.go b/apis/apps/v1/cluster_types.go index e1867dc74c8..2b0c260ceff 100644 --- a/apis/apps/v1/cluster_types.go +++ b/apis/apps/v1/cluster_types.go @@ -537,6 +537,7 @@ type ClusterComponentService struct { // Indicates whether to generate individual Services for each Pod. // If set to true, a separate Service will be created for each Pod in the Cluster. // + // +kubebuilder:default=false // +optional PodService *bool `json:"podService,omitempty"` } diff --git a/apis/apps/v1alpha1/cluster_types.go b/apis/apps/v1alpha1/cluster_types.go index 9d1033569d8..47f1b9b51e8 100644 --- a/apis/apps/v1alpha1/cluster_types.go +++ b/apis/apps/v1alpha1/cluster_types.go @@ -1268,6 +1268,7 @@ type ClusterComponentService struct { // Indicates whether to generate individual Services for each Pod. // If set to true, a separate Service will be created for each Pod in the Cluster. // + // +kubebuilder:default=false // +optional PodService *bool `json:"podService,omitempty"` } diff --git a/config/crd/bases/apps.kubeblocks.io_clusters.yaml b/config/crd/bases/apps.kubeblocks.io_clusters.yaml index 2d4cc34c940..d8f240b431c 100644 --- a/config/crd/bases/apps.kubeblocks.io_clusters.yaml +++ b/config/crd/bases/apps.kubeblocks.io_clusters.yaml @@ -5233,6 +5233,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. @@ -13934,6 +13935,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. @@ -21611,6 +21613,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. @@ -30843,6 +30846,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. diff --git a/config/crd/bases/operations.kubeblocks.io_opsrequests.yaml b/config/crd/bases/operations.kubeblocks.io_opsrequests.yaml index 4dd1102ce19..494f19bfe5c 100644 --- a/config/crd/bases/operations.kubeblocks.io_opsrequests.yaml +++ b/config/crd/bases/operations.kubeblocks.io_opsrequests.yaml @@ -8530,6 +8530,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. diff --git a/controllers/apps/transformer_cluster_component.go b/controllers/apps/transformer_cluster_component.go index 9a8f2f7f30b..49db7eedb8e 100644 --- a/controllers/apps/transformer_cluster_component.go +++ b/controllers/apps/transformer_cluster_component.go @@ -490,10 +490,14 @@ func (c *phasePrecondition) compMatch(transCtx *clusterTransformContext, dag *gr return false, client.IgnoreNotFound(err) } if !c.expected(comp) { + transCtx.Logger.Info("waiting for predecessor component in expected phase", + "component", comp.Name, "predecessor", name) return false, nil } // create or update in DAG? if dagGet() { + transCtx.Logger.Info("waiting for predecessor component in DAG", + "component", comp.Name, "predecessor", name) return false, nil } return true, nil @@ -524,11 +528,15 @@ func (c *phasePrecondition) shardingMatch(transCtx *clusterTransformContext, dag } for _, comp := range comps { if !c.expected(&comp) { + transCtx.Logger.Info("waiting for predecessor sharding in expected phase", + "shard", comp.Name, "predecessor sharding", name) return false, nil } } // create or update in DAG? if dagList() { + transCtx.Logger.Info("waiting for predecessor sharding in DAG", + "shards", comps, "predecessor sharding", name) return false, nil } return true, nil diff --git a/deploy/helm/crds/apps.kubeblocks.io_clusters.yaml b/deploy/helm/crds/apps.kubeblocks.io_clusters.yaml index 2d4cc34c940..d8f240b431c 100644 --- a/deploy/helm/crds/apps.kubeblocks.io_clusters.yaml +++ b/deploy/helm/crds/apps.kubeblocks.io_clusters.yaml @@ -5233,6 +5233,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. @@ -13934,6 +13935,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. @@ -21611,6 +21613,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. @@ -30843,6 +30846,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster. diff --git a/deploy/helm/crds/operations.kubeblocks.io_opsrequests.yaml b/deploy/helm/crds/operations.kubeblocks.io_opsrequests.yaml index 4dd1102ce19..494f19bfe5c 100755 --- a/deploy/helm/crds/operations.kubeblocks.io_opsrequests.yaml +++ b/deploy/helm/crds/operations.kubeblocks.io_opsrequests.yaml @@ -8530,6 +8530,7 @@ spec: maxLength: 25 type: string podService: + default: false description: |- Indicates whether to generate individual Services for each Pod. If set to true, a separate Service will be created for each Pod in the Cluster.