diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index 907e762d1..e18ff68a4 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 9c41127f5..f1da4ae8a 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]+)*$