Skip to content

Commit

Permalink
Add optional field to BundleDeployment API to enable/disable CRD upgr…
Browse files Browse the repository at this point in the history
…ade safety preflight checks

Signed-off-by: Rashmi Gottipati <chowdary.grashmi@gmail.com>
  • Loading branch information
rashmigottipati committed May 29, 2024
1 parent f62d497 commit f5b290a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/v1alpha2/bundledeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions manifests/base/apis/crds/core.rukpak.io_bundledeployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f5b290a

Please sign in to comment.