diff --git a/api/v1beta1/kustomization_types.go b/api/v1beta1/kustomization_types.go index f6cc7469..d8c21bc4 100644 --- a/api/v1beta1/kustomization_types.go +++ b/api/v1beta1/kustomization_types.go @@ -93,8 +93,8 @@ type KustomizationSpec struct { Timeout *metav1.Duration `json:"timeout,omitempty"` // Validate the Kubernetes objects before applying them on the cluster. - // The validation strategy can be 'client' (local dry-run) or 'server' (APIServer dry-run). - // +kubebuilder:validation:Enum=client;server + // The validation strategy can be 'client' (local dry-run), 'server' (APIServer dry-run) or 'none'. + // +kubebuilder:validation:Enum=none;client;server // +optional Validation string `json:"validation,omitempty"` } diff --git a/config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml b/config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml index 67fc7c11..3f976bb6 100644 --- a/config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml +++ b/config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml @@ -196,9 +196,10 @@ spec: type: string validation: description: Validate the Kubernetes objects before applying them - on the cluster. The validation strategy can be 'client' (local dry-run) - or 'server' (APIServer dry-run). + on the cluster. The validation strategy can be 'client' (local dry-run), + 'server' (APIServer dry-run) or 'none'. enum: + - none - client - server type: string diff --git a/controllers/kustomization_controller.go b/controllers/kustomization_controller.go index bf0aef5a..7722b911 100644 --- a/controllers/kustomization_controller.go +++ b/controllers/kustomization_controller.go @@ -569,7 +569,7 @@ func (r *KustomizationReconciler) reconcileDelete(ctx context.Context, log logr. } func (r *KustomizationReconciler) validate(kustomization kustomizev1.Kustomization, dirPath string) error { - if kustomization.Spec.Validation == "" { + if kustomization.Spec.Validation == "" || kustomization.Spec.Validation == "none" { return nil } diff --git a/docs/api/kustomize.md b/docs/api/kustomize.md index 92ffdd76..16654c23 100644 --- a/docs/api/kustomize.md +++ b/docs/api/kustomize.md @@ -239,7 +239,7 @@ string (Optional)

Validate the Kubernetes objects before applying them on the cluster. -The validation strategy can be ‘client’ (local dry-run) or ‘server’ (APIServer dry-run).

+The validation strategy can be ‘client’ (local dry-run), ‘server’ (APIServer dry-run) or ‘none’.

@@ -672,7 +672,7 @@ string (Optional)

Validate the Kubernetes objects before applying them on the cluster. -The validation strategy can be ‘client’ (local dry-run) or ‘server’ (APIServer dry-run).

+The validation strategy can be ‘client’ (local dry-run), ‘server’ (APIServer dry-run) or ‘none’.

diff --git a/docs/spec/v1beta1/kustomization.md b/docs/spec/v1beta1/kustomization.md index 5de69881..49df102a 100644 --- a/docs/spec/v1beta1/kustomization.md +++ b/docs/spec/v1beta1/kustomization.md @@ -66,8 +66,8 @@ type KustomizationSpec struct { Timeout *metav1.Duration `json:"timeout,omitempty"` // Validate the Kubernetes objects before applying them on the cluster. - // The validation strategy can be 'client' (local dry-run) or 'server' (APIServer dry-run). - // +kubebuilder:validation:Enum=client;server + // The validation strategy can be 'client' (local dry-run), 'server' (APIServer dry-run) or 'none'. + // +kubebuilder:validation:Enum=none;client;server // +optional Validation string `json:"validation,omitempty"` }