From 325050ff5aa8795a66ba6fe39dd5dfd66479182f Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Fri, 14 Nov 2025 17:07:14 +0100 Subject: [PATCH] Add enum validation annotation to CollisionProtection Signed-off-by: Per Goncalves da Silva --- api/v1/clusterextensionrevision_types.go | 1 + .../olm.operatorframework.io_clusterextensionrevisions.yaml | 4 ++++ manifests/experimental-e2e.yaml | 4 ++++ manifests/experimental.yaml | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/api/v1/clusterextensionrevision_types.go b/api/v1/clusterextensionrevision_types.go index 13ac4ce2a..79c445e6e 100644 --- a/api/v1/clusterextensionrevision_types.go +++ b/api/v1/clusterextensionrevision_types.go @@ -108,6 +108,7 @@ type ClusterExtensionRevisionObject struct { // already existing on the cluster or even owned by another controller. // // +kubebuilder:default="Prevent" + // +kubebuilder:validation:Enum=Prevent;IfNoController;None // +optional CollisionProtection CollisionProtection `json:"collisionProtection,omitempty"` } diff --git a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml index 5004c8c6f..b11635674 100644 --- a/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml +++ b/helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml @@ -87,6 +87,10 @@ spec: description: |- CollisionProtection controls whether OLM can adopt and modify objects already existing on the cluster or even owned by another controller. + enum: + - Prevent + - IfNoController + - None type: string object: type: object diff --git a/manifests/experimental-e2e.yaml b/manifests/experimental-e2e.yaml index db03c11a8..f39f5d765 100644 --- a/manifests/experimental-e2e.yaml +++ b/manifests/experimental-e2e.yaml @@ -678,6 +678,10 @@ spec: description: |- CollisionProtection controls whether OLM can adopt and modify objects already existing on the cluster or even owned by another controller. + enum: + - Prevent + - IfNoController + - None type: string object: type: object diff --git a/manifests/experimental.yaml b/manifests/experimental.yaml index 664f8599c..44265e031 100644 --- a/manifests/experimental.yaml +++ b/manifests/experimental.yaml @@ -643,6 +643,10 @@ spec: description: |- CollisionProtection controls whether OLM can adopt and modify objects already existing on the cluster or even owned by another controller. + enum: + - Prevent + - IfNoController + - None type: string object: type: object