Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: delete validation rules that prohibit adding/deleting components #5830

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apis/apps/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ type ClusterSpec struct {
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=128
// +kubebuilder:validation:XValidation:rule="self.all(x, size(self.filter(c, c.name == x.name)) == 1)",message="duplicated component"
// +kubebuilder:validation:XValidation:rule="self.all(x, oldSelf.exists(y, y.name == x.name))",message="component can not be added dynamically"
// +kubebuilder:validation:XValidation:rule="oldSelf.all(x, self.exists(y, y.name == x.name))",message="component can not be removed dynamically"
ComponentSpecs []ClusterComponentSpec `json:"componentSpecs,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`

// services defines the services to access a cluster.
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/apps.kubeblocks.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,6 @@ spec:
x-kubernetes-validations:
- message: duplicated component
rule: self.all(x, size(self.filter(c, c.name == x.name)) == 1)
- message: component can not be added dynamically
rule: self.all(x, oldSelf.exists(y, y.name == x.name))
- message: component can not be removed dynamically
rule: oldSelf.all(x, self.exists(y, y.name == x.name))
connectionCredentials:
description: connectionCredentials defines the credentials used to
access a cluster.
Expand Down
4 changes: 0 additions & 4 deletions deploy/helm/crds/apps.kubeblocks.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,6 @@ spec:
x-kubernetes-validations:
- message: duplicated component
rule: self.all(x, size(self.filter(c, c.name == x.name)) == 1)
- message: component can not be added dynamically
rule: self.all(x, oldSelf.exists(y, y.name == x.name))
- message: component can not be removed dynamically
rule: oldSelf.all(x, self.exists(y, y.name == x.name))
connectionCredentials:
description: connectionCredentials defines the credentials used to
access a cluster.
Expand Down