From 9007c97dc881e3beefd3ed69981e76420111fdce Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Fri, 21 Jun 2024 20:21:31 -0400 Subject: [PATCH] fix: make installNamespace immutable Signed-off-by: Joe Lanford --- api/v1alpha1/clusterextension_types.go | 1 + .../crd/bases/olm.operatorframework.io_clusterextensions.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index 907e762d14..e18ff68a4a 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -73,6 +73,7 @@ type ClusterExtensionSpec struct { //+kubebuilder:validation:Pattern:=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ //+kubebuilder:validation:MaxLength:=63 + //+kubebuilder:validation:XValidation:rule="self == oldSelf",message="installNamespace is immutable" // // installNamespace is the namespace where the bundle should be installed. However, note that // the bundle may contain resources that are cluster-scoped or that are diff --git a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml index 9c41127f5d..f1da4ae8ac 100644 --- a/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml +++ b/config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml @@ -52,6 +52,9 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string + x-kubernetes-validations: + - message: installNamespace is immutable + rule: self == oldSelf packageName: maxLength: 48 pattern: ^[a-z0-9]+(-[a-z0-9]+)*$