Skip to content

Commit

Permalink
Address latest 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 e35ad16 commit c4dd907
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
14 changes: 9 additions & 5 deletions api/v1alpha1/clusterextension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,26 @@ type PreflightConfig struct {
}

// CRDUpgradeSafetyPreflightConfig is a custom struct that holds the necessary configuration values to
// enable or disable the CRD Upgrade Safety validations. Currently, this holds CRDUpgradeSafetyPreflightConfigType
// 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".
type CRDUpgradeSafetyPreflightConfig struct {
CRDUpgradeSafetyPreflightConfigType CRDUpgradeSafetyPreflightConfigType `json:"crdUpgradeSafetyPreflightConfigType,omitempty"`
//+kubebuilder:validation:Enum:=Enabled;Disabled
//+kubebuilder:default:=Enabled
//+kubebuilder:Optional
Mode Mode `json:"mode,omitempty"`
}

type CRDUpgradeSafetyPreflightConfigType string
type Mode string

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

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

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ spec:
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 CRDUpgradeSafetyPreflightConfigType
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".
properties:
crdUpgradeSafetyPreflightConfigType:
mode:
default: Enabled
enum:
- Enabled
- Disabled
type: string
type: object
type: object
Expand Down

0 comments on commit c4dd907

Please sign in to comment.