Skip to content

Commit

Permalink
Address the next set of 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 13, 2024
1 parent 30bf1c6 commit 96a459e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
23 changes: 14 additions & 9 deletions api/v1alpha1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
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.

10 changes: 7 additions & 3 deletions config/crd/bases/olm.operatorframework.io_clusterextensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96a459e

Please sign in to comment.