Skip to content

Commit

Permalink
chore: refactor parameters partI: add parameters group and api
Browse files Browse the repository at this point in the history
  • Loading branch information
sophon-zt committed Dec 4, 2024
1 parent 8d25fdb commit 6297fee
Show file tree
Hide file tree
Showing 139 changed files with 11,032 additions and 83 deletions.
35 changes: 34 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ resources:
namespaced: true
controller: true
domain: kubeblocks.io
domain: kubeblocks.io
group: trace
kind: ReconciliationTrace
path: github.com/apecloud/kubeblocks/apis/trace/v1
Expand Down Expand Up @@ -326,4 +325,38 @@ resources:
kind: SidecarDefinition
path: github.com/apecloud/kubeblocks/apis/apps/v1
version: v1
- api:
crdVersion: v1
controller: true
domain: kubeblocks.io
group: parameters
kind: ParametersDefinition
path: github.com/apecloud/kubeblocks/apis/parameters/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
controller: true
domain: kubeblocks.io
group: parameters
kind: ParameterDrivenConfigRender
path: github.com/apecloud/kubeblocks/apis/parameters/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: kubeblocks.io
group: parameters
kind: ComponentParameter
path: github.com/apecloud/kubeblocks/apis/parameters/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: kubeblocks.io
group: parameters
kind: Parameter
path: github.com/apecloud/kubeblocks/apis/parameters/v1alpha1
version: v1alpha1
version: "3"
9 changes: 9 additions & 0 deletions apis/apps/v1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,15 @@ type ClusterComponentSpec struct {
//
// +optional
Stop *bool `json:"stop,omitempty"`

// Specifies the initialization parameters.
//
// +patchMergeKey=name
// +patchStrategy=merge,retainKeys
// +listType=map
// +listMapKey=name
// +optional
InitParameters []ComponentParameter `json:"initParameters,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

type ClusterComponentService struct {
Expand Down
20 changes: 20 additions & 0 deletions apis/apps/v1/component_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,26 @@ type ComponentSpec struct {
//
// +optional
Sidecars []Sidecar `json:"sidecars,omitempty"`

// Specifies the initialization parameters.
//
// +patchMergeKey=name
// +patchStrategy=merge,retainKeys
// +listType=map
// +listMapKey=name
// +optional
InitParameters []ComponentParameter `json:"initParameters,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}

type ComponentParameter struct {
// Specifies the name of the parameter that is to be updated.
// +kubebuilder:validation:Required
Name string `json:"name"`

// Specifies the parameter values that are to be updated.
// If set to nil, the parameter defined by the Key field will be removed from the configuration file.
// +optional
Value *string `json:"value,omitempty"`
}

// ComponentStatus represents the observed state of a Component within the Cluster.
Expand Down
34 changes: 34 additions & 0 deletions apis/apps/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6297fee

Please sign in to comment.