diff --git a/api/v1alpha2/bundledeployment_types.go b/api/v1alpha2/bundledeployment_types.go index 150c6a9a..149753af 100644 --- a/api/v1alpha2/bundledeployment_types.go +++ b/api/v1alpha2/bundledeployment_types.go @@ -69,6 +69,24 @@ type BundleDeploymentSpec struct { // // config is provisioner specific configurations Config runtime.RawExtension `json:"config,omitempty"` + + //+kubebuilder:Optional + // Preflight defines the configuration of preflight checks. + Preflight *PreflightConfig `json:"preflight,omitempty"` +} + +// PreflightConfig holds the configuration for the preflight checks. +type PreflightConfig struct { + //+kubebuilder:Required + // CRDUpgradeSafety holds necessary configuration for the CRD Upgrade Safety preflight checks. + CRDUpgradeSafety *CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety,omitempty"` +} + +// CRDUpgradeSafetyPreflightConfig is the configuration for CRD upgrade safety preflight check. +type CRDUpgradeSafetyPreflightConfig struct { + //+kubebuilder:Required + // Disabled represents the state of the CRD upgrade safety preflight check being disabled/enabled. + Disabled bool `json:"disabled,omitempty"` } // BundleDeploymentStatus defines the observed state of BundleDeployment diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go index 7c12c15d..fff8c5ed 100644 --- a/api/v1alpha2/zz_generated.deepcopy.go +++ b/api/v1alpha2/zz_generated.deepcopy.go @@ -105,6 +105,11 @@ func (in *BundleDeploymentSpec) DeepCopyInto(out *BundleDeploymentSpec) { *out = *in in.Source.DeepCopyInto(&out.Source) in.Config.DeepCopyInto(&out.Config) + if in.Preflight != nil { + in, out := &in.Preflight, &out.Preflight + *out = new(PreflightConfig) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleDeploymentSpec. @@ -179,6 +184,21 @@ func (in *BundleSource) DeepCopy() *BundleSource { 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 *ConfigMapSource) DeepCopyInto(out *ConfigMapSource) { *out = *in @@ -257,3 +277,23 @@ func (in *ImageSource) DeepCopy() *ImageSource { in.DeepCopyInto(out) return out } + +// 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 + if in.CRDUpgradeSafety != nil { + in, out := &in.CRDUpgradeSafety, &out.CRDUpgradeSafety + *out = new(CRDUpgradeSafetyPreflightConfig) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreflightConfig. +func (in *PreflightConfig) DeepCopy() *PreflightConfig { + if in == nil { + return nil + } + out := new(PreflightConfig) + in.DeepCopyInto(out) + return out +} diff --git a/manifests/base/apis/crds/core.rukpak.io_bundledeployments.yaml b/manifests/base/apis/crds/core.rukpak.io_bundledeployments.yaml index 2f7eb25a..e6a6425e 100644 --- a/manifests/base/apis/crds/core.rukpak.io_bundledeployments.yaml +++ b/manifests/base/apis/crds/core.rukpak.io_bundledeployments.yaml @@ -65,6 +65,19 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string + preflight: + description: Preflight defines the configuration of preflight checks. + properties: + crdUpgradeSafety: + description: CRDUpgradeSafety holds necessary configuration for + the CRD Upgrade Safety preflight checks. + properties: + disabled: + description: Disabled represents the state of the CRD upgrade + safety preflight check being disabled/enabled. + type: boolean + type: object + type: object provisionerClassName: description: provisionerClassName sets the name of the provisioner that should reconcile this BundleDeployment.