Skip to content

Commit

Permalink
feat: make control namespace field immutable
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <[email protected]>
  • Loading branch information
csatib02 committed Dec 6, 2024
1 parent 9a91a03 commit ddc21ce
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ spec:
type: object
controlNamespace:
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
image:
properties:
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ spec:
type: object
controlNamespace:
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
defaultFlow:
properties:
filters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ spec:
type: object
controlNamespace:
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
image:
properties:
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
type: object
controlNamespace:
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
defaultFlow:
properties:
filters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ spec:
type: object
controlNamespace:
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
image:
properties:
imagePullSecrets:
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/logging.banzaicloud.io_loggings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
type: object
controlNamespace:
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
defaultFlow:
properties:
filters:
Expand Down
3 changes: 2 additions & 1 deletion pkg/sdk/extensions/api/v1alpha1/eventtailer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ type _metaEventTailer = interface{} //nolint:deadcode,unused

// EventTailerSpec defines the desired state of EventTailer
type EventTailerSpec struct {
//+kubebuilder:validation:Required
// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable, please recreate the resource"

// The resources of EventTailer will be placed into this namespace
ControlNamespace string `json:"controlNamespace"`
Expand Down
4 changes: 4 additions & 0 deletions pkg/sdk/logging/api/v1beta1/logging_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ type LoggingSpec struct {
WatchNamespaceSelector *metav1.LabelSelector `json:"watchNamespaceSelector,omitempty"`
// Cluster domain name to be used when templating URLs to services (default: "cluster.local.").
ClusterDomain *string `json:"clusterDomain,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable, please recreate the resource"

// Namespace for cluster wide configuration resources like ClusterFlow and ClusterOutput.
// This should be a protected namespace from regular users.
// Resources like fluentbit and fluentd will run in this namespace as well.
Expand Down

0 comments on commit ddc21ce

Please sign in to comment.