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 723651b commit 63a4b7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/telemetry/v1alpha1/collector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ type CollectorSpec struct {
// TenantSelector is used to select tenants for which the collector should collect data.
TenantSelector metav1.LabelSelector `json:"tenantSelector,omitempty"`

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

// Namespace where the Otel collector DaemonSet is deployed.
ControlNamespace string `json:"controlNamespace"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
controlNamespace:
description: Namespace where the Otel collector DaemonSet is deployed.
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
daemonSet:
description: DaemonSetOverrides is used to override the default DaemonSet
configuration.
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/telemetry.kube-logging.dev_collectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
controlNamespace:
description: Namespace where the Otel collector DaemonSet is deployed.
type: string
x-kubernetes-validations:
- message: Value is immutable, please recreate the resource
rule: self == oldSelf
daemonSet:
description: DaemonSetOverrides is used to override the default DaemonSet
configuration.
Expand Down

0 comments on commit 63a4b7c

Please sign in to comment.