From d4bffc491b212738395c129eee1cb01f78b66981 Mon Sep 17 00:00:00 2001 From: Bryce Palmer Date: Wed, 27 Mar 2024 08:58:55 -0400 Subject: [PATCH] Add field to Extension API to skip crd safety checks (#699) Signed-off-by: everettraven --- Makefile | 2 +- api/v1alpha1/extension_types.go | 5 +++++ config/crd/bases/olm.operatorframework.io_extensions.yaml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1567545c6..ec7dbfca6 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyI $(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..." .PHONY: verify -verify: tidy fmt vet generate #HELP Verify all generated code is up-to-date. +verify: tidy fmt vet generate manifests #HELP Verify all generated code is up-to-date. git diff --exit-code .PHONY: fmt diff --git a/api/v1alpha1/extension_types.go b/api/v1alpha1/extension_types.go index 4da6e00b9..cf2a64861 100644 --- a/api/v1alpha1/extension_types.go +++ b/api/v1alpha1/extension_types.go @@ -82,6 +82,11 @@ type ExtensionSpec struct { // source of Extension to be installed Source ExtensionSource `json:"source"` + + //+kubebuilder:Optional + // + // skipCRDUpgradeSafetyCheck specifies whether or not the CRD upgrade safety checks should be skipped when attempting to install the extension + SkipCRDUpgradeSafetyCheck bool `json:"skipCRDUpgradeSafetyCheck,omitempty"` } // ExtensionStatus defines the observed state of Extension diff --git a/config/crd/bases/olm.operatorframework.io_extensions.yaml b/config/crd/bases/olm.operatorframework.io_extensions.yaml index b6394dc0b..57ae4b959 100644 --- a/config/crd/bases/olm.operatorframework.io_extensions.yaml +++ b/config/crd/bases/olm.operatorframework.io_extensions.yaml @@ -51,6 +51,11 @@ spec: maxLength: 253 pattern: ^[a-z0-9]+([\.-][a-z0-9]+)*$ type: string + skipCRDUpgradeSafetyCheck: + description: skipCRDUpgradeSafetyCheck specifies whether or not the + CRD upgrade safety checks should be skipped when attempting to install + the extension + type: boolean source: description: source of Extension to be installed properties: