Skip to content

Commit adb8abe

Browse files
committed
Added validation to check if OKD has all default featuregates and rebased repo
1 parent 632af4b commit adb8abe

23 files changed

+2340
-542
lines changed

config/v1/types_feature.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ var (
5353
// your cluster may fail in an unrecoverable way.
5454
CustomNoUpgrade FeatureSet = "CustomNoUpgrade"
5555

56-
// OKD turns on features for OKD. Turning this feature set ON is supported for OKD clusters, but NOT for OpenShift clusters
57-
// this feature set on CANNOT BE UNDONE for OKD clusters and when enabled on OpenShift clusters it PREVENTS UPGRADES.
56+
// OKD turns on features for OKD. Turning this feature set ON is supported for OKD clusters, but NOT for OpenShift clusters.
57+
// Once enabled, this feature set cannot be changed back to Default, but can be changed to other feature sets and it allows upgrades.
5858
OKD FeatureSet = "OKD"
5959

6060
// AllFixedFeatureSets are the featuresets that have known featuregates. Custom doesn't for instance. LatencySensitive is dead
@@ -75,7 +75,7 @@ type FeatureGateSelection struct {
7575
// +kubebuilder:validation:XValidation:rule="oldSelf == 'CustomNoUpgrade' ? self == 'CustomNoUpgrade' : true",message="CustomNoUpgrade may not be changed"
7676
// +kubebuilder:validation:XValidation:rule="oldSelf == 'TechPreviewNoUpgrade' ? self == 'TechPreviewNoUpgrade' : true",message="TechPreviewNoUpgrade may not be changed"
7777
// +kubebuilder:validation:XValidation:rule="oldSelf == 'DevPreviewNoUpgrade' ? self == 'DevPreviewNoUpgrade' : true",message="DevPreviewNoUpgrade may not be changed"
78-
// +kubebuilder:validation:XValidation:rule="oldSelf == 'OKD' ? self == 'OKD' : true",message="OKD may not be changed"
78+
// +kubebuilder:validation:XValidation:rule="oldSelf == 'OKD' ? self != '' : true",message="OKD cannot transition to Default"
7979
FeatureSet FeatureSet `json:"featureSet,omitempty"`
8080

8181
// customNoUpgrade allows the enabling or disabling of any feature. Turning this feature set on IS NOT SUPPORTED, CANNOT BE UNDONE, and PREVENTS UPGRADES.

config/v1/zz_generated.crd-manifests/0000_00_cluster-version-operator_01_clusterversions-OKD.crd.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ spec:
180180
operator and you have verified the authenticity of the provided
181181
image yourself.
182182
The provided image will run with full administrative access
183-
to the cluster. Do not use this flag with images that comes from unknown
183+
to the cluster. Do not use this flag with images that come from unknown
184184
or potentially malicious sources.
185185
type: boolean
186186
image:
@@ -273,6 +273,17 @@ spec:
273273
description: Release represents an OpenShift release image and associated
274274
metadata.
275275
properties:
276+
architecture:
277+
description: |-
278+
architecture is an optional field that indicates the
279+
value of the cluster architecture. In this context cluster
280+
architecture means either a single architecture or a multi
281+
architecture.
282+
Valid values are 'Multi' and empty.
283+
enum:
284+
- Multi
285+
- ""
286+
type: string
276287
channels:
277288
description: |-
278289
channels is the set of Cincinnati channels to which the release
@@ -448,6 +459,17 @@ spec:
448459
release:
449460
description: release is the target of the update.
450461
properties:
462+
architecture:
463+
description: |-
464+
architecture is an optional field that indicates the
465+
value of the cluster architecture. In this context cluster
466+
architecture means either a single architecture or a multi
467+
architecture.
468+
Valid values are 'Multi' and empty.
469+
enum:
470+
- Multi
471+
- ""
472+
type: string
451473
channels:
452474
description: |-
453475
channels is the set of Cincinnati channels to which the release
@@ -623,6 +645,17 @@ spec:
623645
If the cluster is not yet fully initialized desired will be set
624646
with the information available, which may be an image or a tag.
625647
properties:
648+
architecture:
649+
description: |-
650+
architecture is an optional field that indicates the
651+
value of the cluster architecture. In this context cluster
652+
architecture means either a single architecture or a multi
653+
architecture.
654+
Valid values are 'Multi' and empty.
655+
enum:
656+
- Multi
657+
- ""
658+
type: string
626659
channels:
627660
description: |-
628661
channels is the set of Cincinnati channels to which the release

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_featuregates.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ spec:
9292
- message: DevPreviewNoUpgrade may not be changed
9393
rule: 'oldSelf == ''DevPreviewNoUpgrade'' ? self == ''DevPreviewNoUpgrade''
9494
: true'
95-
- message: OKD may not be changed
96-
rule: 'oldSelf == ''OKD'' ? self == ''OKD'' : true'
95+
- message: OKD cannot transition to Default
96+
rule: 'oldSelf == ''OKD'' ? self != '''' : true'
9797
type: object
9898
x-kubernetes-validations:
9999
- message: .spec.featureSet cannot be removed

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_images-OKD.crd.yaml

Lines changed: 0 additions & 183 deletions
This file was deleted.

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-OKD.crd.yaml renamed to config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_schedulers-SelfManagedHA-OKD.crd.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ metadata:
44
annotations:
55
api-approved.openshift.io: https://github.com/openshift/api/pull/470
66
api.openshift.io/merged-by-featuregates: "true"
7-
include.release.openshift.io/ibm-cloud-managed: "true"
87
include.release.openshift.io/self-managed-high-availability: "true"
98
release.openshift.io/bootstrap-required: "true"
109
release.openshift.io/feature-set: OKD

config/v1/zz_generated.featuregated-crd-manifests/featuregates.config.openshift.io/AAA_ungated.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ spec:
9393
- message: DevPreviewNoUpgrade may not be changed
9494
rule: 'oldSelf == ''DevPreviewNoUpgrade'' ? self == ''DevPreviewNoUpgrade''
9595
: true'
96-
- message: OKD may not be changed
97-
rule: 'oldSelf == ''OKD'' ? self == ''OKD'' : true'
96+
- message: OKD cannot transition to Default
97+
rule: 'oldSelf == ''OKD'' ? self != '''' : true'
9898
type: object
9999
x-kubernetes-validations:
100100
- message: .spec.featureSet cannot be removed

0 commit comments

Comments
 (0)