diff --git a/api/v1alpha1/clusterextension_types.go b/api/v1alpha1/clusterextension_types.go index 55bb90029..ad9156d02 100644 --- a/api/v1alpha1/clusterextension_types.go +++ b/api/v1alpha1/clusterextension_types.go @@ -85,18 +85,23 @@ type PreflightConfig struct { CRDUpgradeSafety CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety,omitempty"` } -// CRDUpgradeSafetyPreflightConfig is a custom type to hold value for the CRDUpgradeSafetyPreflightConfig -// that enables or disables the CRD Upgrade Safety validations. -type CRDUpgradeSafetyPreflightConfig string +// CRDUpgradeSafetyPreflightConfig is a custom struct that holds the necessary configuration values to +// enable or disable the CRD Upgrade Safety validations. Currently, this holds CRDUpgradeSafetyPreflightConfigType +// that sets the CRD Upgrade Safety validations to either Enabled/Disabled. +type CRDUpgradeSafetyPreflightConfig struct { + CRDUpgradeSafetyPreflightConfigType CRDUpgradeSafetyPreflightConfigType `json:"crdUpgradeSafetyPreflightConfigType,omitempty"` +} + +type CRDUpgradeSafetyPreflightConfigType string const ( - // CRDUpgradeSafetyPreflightConfigApply represents the default state for the - // CRD Upgrade Safety validations by setting it to "Apply". - CRDUpgradeSafetyPreflightConfigApply CRDUpgradeSafetyPreflightConfig = "Apply" + // CRDUpgradeSafetyPreflightConfigEnabled represents the default state for the + // CRD Upgrade Safety validations by setting it to "Enabled". + CRDUpgradeSafetyPreflightConfigEnabled CRDUpgradeSafetyPreflightConfigType = "Enabled" - // CRDUpgradeSafetyPreflightConfigSkip represents the option for the - // CRD Upgrade Safety validations to be skipped by setting it to "Skip". - CRDUpgradeSafetyPreflightConfigSkip CRDUpgradeSafetyPreflightConfig = "Skip" + // CRDUpgradeSafetyPreflightConfigDisabled represents the option for the + // CRD Upgrade Safety validations to be disabled by setting it to "Disabled". + CRDUpgradeSafetyPreflightConfigDisabled CRDUpgradeSafetyPreflightConfigType = "Disabled" ) const ( diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 961539466..d390c1bac 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -40,6 +40,21 @@ func (in *BundleMetadata) DeepCopy() *BundleMetadata { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CRDUpgradeSafetyPreflightConfig) DeepCopyInto(out *CRDUpgradeSafetyPreflightConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRDUpgradeSafetyPreflightConfig. +func (in *CRDUpgradeSafetyPreflightConfig) DeepCopy() *CRDUpgradeSafetyPreflightConfig { + if in == nil { + return nil + } + out := new(CRDUpgradeSafetyPreflightConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterExtension) DeepCopyInto(out *ClusterExtension) { *out = *in @@ -292,6 +307,7 @@ func (in *ExtensionStatus) DeepCopy() *ExtensionStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PreflightConfig) DeepCopyInto(out *PreflightConfig) { *out = *in + out.CRDUpgradeSafety = in.CRDUpgradeSafety } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreflightConfig. diff --git a/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml b/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml index cd76b7b4d..ae8e9d1bb 100644 --- a/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml +++ b/config/crd/bases/olm.operatorframework.io_clusterextensions.yaml @@ -63,9 +63,13 @@ spec: properties: crdUpgradeSafety: description: |- - CRDUpgradeSafetyPreflightConfig is a custom type to hold value for the CRDUpgradeSafetyPreflightConfig - that enables or disables the CRD Upgrade Safety validations. - type: string + CRDUpgradeSafetyPreflightConfig is a custom struct that holds the necessary configuration values to + enable or disable the CRD Upgrade Safety validations. Currently, this holds CRDUpgradeSafetyPreflightConfigType + that sets the CRD Upgrade Safety validations to either Enabled/Disabled. + properties: + crdUpgradeSafetyPreflightConfigType: + type: string + type: object type: object upgradeConstraintPolicy: default: Enforce