From c4dd90710fb62661560e8972ae87aea92f8f76c6 Mon Sep 17 00:00:00 2001 From: Rashmi Gottipati Date: Mon, 13 May 2024 16:53:42 -0400 Subject: [PATCH] Address latest review feedback Signed-off-by: Rashmi Gottipati --- api/v1alpha1/clusterextension_types.go | 14 +++++++++----- ...olm.operatorframework.io_clusterextensions.yaml | 9 +++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index ad9156d02..93a7107c7 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -86,22 +86,26 @@ type PreflightConfig struct { } // CRDUpgradeSafetyPreflightConfig is a custom struct that holds the necessary configuration values to -// enable or disable the CRD Upgrade Safety validations. Currently, this holds CRDUpgradeSafetyPreflightConfigType +// enable or disable the CRD Upgrade Safety validations. Currently, this holds Mode // that sets the CRD Upgrade Safety validations to either Enabled/Disabled. +// By default, this is set to "Enabled". type CRDUpgradeSafetyPreflightConfig struct { - CRDUpgradeSafetyPreflightConfigType CRDUpgradeSafetyPreflightConfigType `json:"crdUpgradeSafetyPreflightConfigType,omitempty"` + //+kubebuilder:validation:Enum:=Enabled;Disabled + //+kubebuilder:default:=Enabled + //+kubebuilder:Optional + Mode Mode `json:"mode,omitempty"` } -type CRDUpgradeSafetyPreflightConfigType string +type Mode string const ( // CRDUpgradeSafetyPreflightConfigEnabled represents the default state for the // CRD Upgrade Safety validations by setting it to "Enabled". - CRDUpgradeSafetyPreflightConfigEnabled CRDUpgradeSafetyPreflightConfigType = "Enabled" + CRDUpgradeSafetyPreflightConfigEnabled Mode = "Enabled" // CRDUpgradeSafetyPreflightConfigDisabled represents the option for the // CRD Upgrade Safety validations to be disabled by setting it to "Disabled". - CRDUpgradeSafetyPreflightConfigDisabled CRDUpgradeSafetyPreflightConfigType = "Disabled" + CRDUpgradeSafetyPreflightConfigDisabled Mode = "Disabled" ) const ( diff --git a/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml b/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml index ae8e9d1bb..c132d81cf 100644 --- a/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml +++ b/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml @@ -64,10 +64,15 @@ spec: crdUpgradeSafety: description: |- CRDUpgradeSafetyPreflightConfig is a custom struct that holds the necessary configuration values to - enable or disable the CRD Upgrade Safety validations. Currently, this holds CRDUpgradeSafetyPreflightConfigType + enable or disable the CRD Upgrade Safety validations. Currently, this holds Mode that sets the CRD Upgrade Safety validations to either Enabled/Disabled. + By default, this is set to "Enabled". properties: - crdUpgradeSafetyPreflightConfigType: + mode: + default: Enabled + enum: + - Enabled + - Disabled type: string type: object type: object