diff --git a/apis/apps/v1alpha1/type.go b/apis/apps/v1alpha1/type.go index 47734adce49..2fe2a455b60 100644 --- a/apis/apps/v1alpha1/type.go +++ b/apis/apps/v1alpha1/type.go @@ -207,12 +207,13 @@ type ComponentConfigSpec struct { // RerenderResourceType defines the resource requirements for a component. // +enum -// +kubebuilder:validation:Enum={vscale,hscale,tls} +// +kubebuilder:validation:Enum={vscale,hscale,tls,shardingHScale} type RerenderResourceType string const ( - ComponentVScaleType RerenderResourceType = "vscale" - ComponentHScaleType RerenderResourceType = "hscale" + ComponentVScaleType RerenderResourceType = "vscale" + ComponentHScaleType RerenderResourceType = "hscale" + ShardingComponentHScaleType RerenderResourceType = "shardingHScale" ) // MergedPolicy defines how to merge external imported templates into component templates. diff --git a/config/crd/bases/apps.kubeblocks.io_clusterdefinitions.yaml b/config/crd/bases/apps.kubeblocks.io_clusterdefinitions.yaml index 2e7ce33926d..0d2e5a68a13 100644 --- a/config/crd/bases/apps.kubeblocks.io_clusterdefinitions.yaml +++ b/config/crd/bases/apps.kubeblocks.io_clusterdefinitions.yaml @@ -589,6 +589,7 @@ spec: - vscale - hscale - tls + - shardingHScale type: string type: array x-kubernetes-list-type: set diff --git a/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml b/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml index fe6bec4e932..dbe357e099c 100644 --- a/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml +++ b/config/crd/bases/apps.kubeblocks.io_componentdefinitions.yaml @@ -17918,6 +17918,7 @@ spec: - vscale - hscale - tls + - shardingHScale type: string type: array x-kubernetes-list-type: set diff --git a/config/crd/bases/apps.kubeblocks.io_configurations.yaml b/config/crd/bases/apps.kubeblocks.io_configurations.yaml index 90310656942..869c96905f5 100644 --- a/config/crd/bases/apps.kubeblocks.io_configurations.yaml +++ b/config/crd/bases/apps.kubeblocks.io_configurations.yaml @@ -271,6 +271,7 @@ spec: - vscale - hscale - tls + - shardingHScale type: string type: array x-kubernetes-list-type: set diff --git a/controllers/apps/component/transformer_component_parameters.go b/controllers/apps/component/transformer_component_parameters.go index d4b5f7c8531..6af22cd1c92 100644 --- a/controllers/apps/component/transformer_component_parameters.go +++ b/controllers/apps/component/transformer_component_parameters.go @@ -24,7 +24,7 @@ import ( appsv1alpha1 "github.com/apecloud/kubeblocks/apis/apps/v1alpha1" cfgcore "github.com/apecloud/kubeblocks/pkg/configuration/core" - "github.com/apecloud/kubeblocks/pkg/controller/configuration" + configctrl "github.com/apecloud/kubeblocks/pkg/controller/configuration" "github.com/apecloud/kubeblocks/pkg/controller/graph" ) @@ -46,7 +46,7 @@ func (c *componentRelatedParametersTransformer) Transform(ctx graph.TransformCon } configNew := config.DeepCopy() - updated, err := configuration.UpdateConfigPayload(&configNew.Spec, synthesizedComp) + updated, err := configctrl.UpdateConfigPayload(&configNew.Spec, synthesizedComp, configctrl.ResolveShardingReference(transCtx.Component, transCtx.Cluster)) if err != nil { return err } diff --git a/deploy/helm/crds/apps.kubeblocks.io_clusterdefinitions.yaml b/deploy/helm/crds/apps.kubeblocks.io_clusterdefinitions.yaml index 2e7ce33926d..0d2e5a68a13 100644 --- a/deploy/helm/crds/apps.kubeblocks.io_clusterdefinitions.yaml +++ b/deploy/helm/crds/apps.kubeblocks.io_clusterdefinitions.yaml @@ -589,6 +589,7 @@ spec: - vscale - hscale - tls + - shardingHScale type: string type: array x-kubernetes-list-type: set diff --git a/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml b/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml index fe6bec4e932..dbe357e099c 100644 --- a/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml +++ b/deploy/helm/crds/apps.kubeblocks.io_componentdefinitions.yaml @@ -17918,6 +17918,7 @@ spec: - vscale - hscale - tls + - shardingHScale type: string type: array x-kubernetes-list-type: set diff --git a/deploy/helm/crds/apps.kubeblocks.io_configurations.yaml b/deploy/helm/crds/apps.kubeblocks.io_configurations.yaml index 90310656942..869c96905f5 100644 --- a/deploy/helm/crds/apps.kubeblocks.io_configurations.yaml +++ b/deploy/helm/crds/apps.kubeblocks.io_configurations.yaml @@ -271,6 +271,7 @@ spec: - vscale - hscale - tls + - shardingHScale type: string type: array x-kubernetes-list-type: set diff --git a/docs/developer_docs/api-reference/cluster.md b/docs/developer_docs/api-reference/cluster.md index 1fb5b6f1892..ff43a546400 100644 --- a/docs/developer_docs/api-reference/cluster.md +++ b/docs/developer_docs/api-reference/cluster.md @@ -24453,6 +24453,8 @@ StatefulSetSpec
"vscale"
"shardingHScale"