Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Rashmi Gottipati <chowdary.grashmi@gmail.com>
  • Loading branch information
rashmigottipati committed May 23, 2024
1 parent b31432d commit c3f5740
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 42 deletions.
30 changes: 8 additions & 22 deletions api/v1alpha2/bundledeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,40 +71,26 @@ type BundleDeploymentSpec struct {
Config runtime.RawExtension `json:"config,omitempty"`

//+kubebuilder:Optional
// Preflight defines the strategy for the preflight checks (i.e. as of now, the CRD upgrade safety checks) to be enabled or disabled when attempting to install the BundleDeployment.
// Preflight defines the configuration of preflight checks.
Preflight *PreflightConfig `json:"preflight,omitempty"`
}

// PreflightConfig holds the config for the preflight checks. Currently, this is implemented for the
// CRDUpgradeSafety preflight check and can be extended in the future to add other preflight checks.
// PreflightConfig holds the configuration for the preflight checks.
type PreflightConfig struct {
//+kubebuilder:Optional
// CRDUpgradeSafety holds necessary configuration for the CRD Upgrade Safety preflight checks.
CRDUpgradeSafety *CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety,omitempty"`
}

// CRDUpgradeSafetyPreflightConfig is a custom struct that holds the necessary configuration values to
// 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".
// CRDUpgradeSafetyPreflightConfig is the configuration for CRD upgrade safety preflight check.
type CRDUpgradeSafetyPreflightConfig struct {
//+kubebuilder:validation:Enum:=Enabled;Disabled
//+kubebuilder:default:=Enabled
//+kubebuilder:default:=true
//+kubebuilder:Optional
Mode *CRDUpgradeSafetyMode `json:"mode,omitempty"`
// Enabled represents the state of the CRD upgrade safety preflight check being enabled/disabled.
// The default value is true.
Enabled bool `json:"enabled,omitempty"`
}

type CRDUpgradeSafetyMode string

const (
// CRDUpgradeSafetyModeEnabled represents the default state for the
// CRD Upgrade Safety validations by setting it to "Enabled".
CRDUpgradeSafetyModeEnabled CRDUpgradeSafetyMode = "Enabled"

// CRDUpgradeSafetyModeDisabled represents the option for the
// CRD Upgrade Safety validations to be disabled by setting it to "Disabled".
CRDUpgradeSafetyModeDisabled CRDUpgradeSafetyMode = "Disabled"
)

// BundleDeploymentStatus defines the observed state of BundleDeployment
type BundleDeploymentStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
Expand Down
7 changes: 1 addition & 6 deletions api/v1alpha2/zz_generated.deepcopy.go

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

23 changes: 9 additions & 14 deletions manifests/base/apis/crds/core.rukpak.io_bundledeployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,18 @@ spec:
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
preflight:
description: Preflight defines the strategy for the preflight checks
(i.e. as of now, the CRD upgrade safety checks) to be enabled or
disabled when attempting to install the BundleDeployment.
description: Preflight defines the configuration of preflight checks.
properties:
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 Mode
that sets the CRD Upgrade Safety validations to either Enabled/Disabled.
By default, this is set to "Enabled".
description: CRDUpgradeSafety holds necessary configuration for
the CRD Upgrade Safety preflight checks.
properties:
mode:
default: Enabled
enum:
- Enabled
- Disabled
type: string
enabled:
default: true
description: |-
Enabled represents the state of the CRD upgrade safety preflight check being enabled/disabled.
The default value is true.
type: boolean
type: object
type: object
provisionerClassName:
Expand Down

0 comments on commit c3f5740

Please sign in to comment.