Skip to content

Commit

Permalink
Address review feedback
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 13, 2024
1 parent 52a18b1 commit c1c586b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
24 changes: 22 additions & 2 deletions api/v1alpha1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,30 @@ type ClusterExtensionSpec struct {
InstallNamespace string `json:"installNamespace"`

//+kubebuilder:Optional
// skipCRDUpgradeSafetyCheck specifies whether or not the CRD upgrade safety checks should be skipped when attempting to install the cluster extension.
SkipCRDUpgradeSafetyCheck bool `json:"skipCRDUpgradeSafetyCheck,omitempty"`
// Preflight defines the strategy for the preflight checks (i.e. as of now, the CRD upgrade safety checks) to be applied or skipped when attempting to install the cluster extension.
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.
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

const (
// CRDUpgradeSafetyPreflightConfigApply represents the default state for the
// CRD Upgrade Safety validations by setting it to "Apply".
CRDUpgradeSafetyPreflightConfigApply CRDUpgradeSafetyPreflightConfig = "Apply"

// CRDUpgradeSafetyPreflightConfigSkip represents the option for the
// CRD Upgrade Safety validations to be skipped by setting it to "Skip".
CRDUpgradeSafetyPreflightConfigSkip CRDUpgradeSafetyPreflightConfig = "Skip"
)

const (
// TODO(user): add more Types, here and into init()
TypeInstalled = "Installed"
Expand Down
16 changes: 16 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

16 changes: 11 additions & 5 deletions config/crd/bases/olm.operatorframework.io_clusterextensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@ spec:
maxLength: 48
pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
type: string
skipCRDUpgradeSafetyCheck:
description: skipCRDUpgradeSafetyCheck specifies whether or not the
CRD upgrade safety checks should be skipped when attempting to install
the cluster extension.
type: boolean
preflight:
description: Preflight defines the strategy for the preflight checks
(i.e. as of now, the CRD upgrade safety checks) to be applied or
skipped when attempting to install the cluster extension.
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
type: object
upgradeConstraintPolicy:
default: Enforce
description: Defines the policy for how to handle upgrade constraints
Expand Down

0 comments on commit c1c586b

Please sign in to comment.