Skip to content

Commit 4e11636

Browse files
committed
Added vSphere Day 2 logic to CRDs
1 parent d0af9d7 commit 4e11636

48 files changed

Lines changed: 5372 additions & 428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/v1/types_infrastructure.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ type ExternalPlatformSpec struct {
295295
// PlatformSpec holds the desired state specific to the underlying infrastructure provider
296296
// of the current cluster. Since these are used at spec-level for the underlying cluster, it
297297
// is supposed that only one of the spec structs is set.
298-
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install"
298+
// +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters) ? size(self.vsphere.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install"
299+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="has(oldSelf.vsphere) && has(oldSelf.vsphere.vcenters) ? (has(self.vsphere) && has(self.vsphere.vcenters) && size(self.vsphere.vcenters) > 0) : true",message="vcenters is required once set and must have at least 1 item"
300+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters) ? size(self.vsphere.vcenters) > 0 : true",message="vcenters must have at least 1 item when initially configured"
299301
type PlatformSpec struct {
300302
// type is the underlying infrastructure provider for the cluster. This
301303
// value controls whether infrastructure automation such as service load
@@ -1641,7 +1643,9 @@ type VSpherePlatformNodeNetworking struct {
16411643
// use these fields for configuration.
16421644
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
16431645
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
1644-
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install"
1646+
// +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters) < 2 : true",message="vcenters can have at most 1 item when configured post-install"
1647+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="!has(oldSelf.vcenters) || has(self.vcenters)",message="vcenters is required once set"
1648+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="has(self.vcenters) ? size(self.vcenters) > 0 : true",message="vcenters must have at least 1 item"
16451649
type VSpherePlatformSpec struct {
16461650
// vcenters holds the connection details for services to communicate with vCenter.
16471651
// Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
@@ -1655,7 +1659,8 @@ type VSpherePlatformSpec struct {
16551659
// + in openshift-config.
16561660
// +kubebuilder:validation:MinItems=0
16571661
// +kubebuilder:validation:MaxItems=3
1658-
// +kubebuilder:validation:XValidation:rule="size(self) != size(oldSelf) ? size(oldSelf) == 0 && size(self) < 2 : true",message="vcenters cannot be added or removed once set"
1662+
// +openshift:validation:FeatureGateAwareXValidation:featureGate="",rule="size(self) != size(oldSelf) ? size(oldSelf) == 0 && size(self) < 2 : true",message="vcenters cannot be added or removed once set"
1663+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="size(self) != size(oldSelf) ? size(self) > 0 : true",message="vcenters must have at least 1 item"
16591664
// +listType=atomic
16601665
// +optional
16611666
VCenters []VSpherePlatformVCenterSpec `json:"vcenters,omitempty"`

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,23 +1083,28 @@ spec:
10831083
type: array
10841084
x-kubernetes-list-type: atomic
10851085
x-kubernetes-validations:
1086-
- message: vcenters cannot be added or removed once set
1087-
rule: 'size(self) != size(oldSelf) ? size(oldSelf) == 0
1088-
&& size(self) < 2 : true'
1086+
- message: vcenters must have at least 1 item
1087+
rule: 'size(self) != size(oldSelf) ? size(self) > 0 : true'
10891088
type: object
10901089
x-kubernetes-validations:
1090+
- message: vcenters is required once set
1091+
rule: '!has(oldSelf.vcenters) || has(self.vcenters)'
1092+
- message: vcenters must have at least 1 item
1093+
rule: 'has(self.vcenters) ? size(self.vcenters) > 0 : true'
10911094
- message: apiServerInternalIPs list is required once set
10921095
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
10931096
- message: ingressIPs list is required once set
10941097
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1095-
- message: vcenters can have at most 1 item when configured post-install
1096-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1097-
< 2 : true'
10981098
type: object
10991099
x-kubernetes-validations:
1100-
- message: vcenters can have at most 1 item when configured post-install
1101-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1102-
< 2 : true'
1100+
- message: vcenters is required once set and must have at least 1
1101+
item
1102+
rule: 'has(oldSelf.vsphere) && has(oldSelf.vsphere.vcenters) ? (has(self.vsphere)
1103+
&& has(self.vsphere.vcenters) && size(self.vsphere.vcenters) >
1104+
0) : true'
1105+
- message: vcenters must have at least 1 item when initially configured
1106+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1107+
? size(self.vsphere.vcenters) > 0 : true'
11031108
type: object
11041109
status:
11051110
description: status holds observed values from the cluster. They may not

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,14 +1026,11 @@ spec:
10261026
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
10271027
- message: ingressIPs list is required once set
10281028
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1029-
- message: vcenters can have at most 1 item when configured post-install
1030-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1031-
< 2 : true'
10321029
type: object
10331030
x-kubernetes-validations:
10341031
- message: vcenters can have at most 1 item when configured post-install
1035-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1036-
< 2 : true'
1032+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1033+
? size(self.vsphere.vcenters) < 2 : true'
10371034
type: object
10381035
status:
10391036
description: status holds observed values from the cluster. They may not

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,23 +1083,28 @@ spec:
10831083
type: array
10841084
x-kubernetes-list-type: atomic
10851085
x-kubernetes-validations:
1086-
- message: vcenters cannot be added or removed once set
1087-
rule: 'size(self) != size(oldSelf) ? size(oldSelf) == 0
1088-
&& size(self) < 2 : true'
1086+
- message: vcenters must have at least 1 item
1087+
rule: 'size(self) != size(oldSelf) ? size(self) > 0 : true'
10891088
type: object
10901089
x-kubernetes-validations:
1090+
- message: vcenters is required once set
1091+
rule: '!has(oldSelf.vcenters) || has(self.vcenters)'
1092+
- message: vcenters must have at least 1 item
1093+
rule: 'has(self.vcenters) ? size(self.vcenters) > 0 : true'
10911094
- message: apiServerInternalIPs list is required once set
10921095
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
10931096
- message: ingressIPs list is required once set
10941097
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1095-
- message: vcenters can have at most 1 item when configured post-install
1096-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1097-
< 2 : true'
10981098
type: object
10991099
x-kubernetes-validations:
1100-
- message: vcenters can have at most 1 item when configured post-install
1101-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1102-
< 2 : true'
1100+
- message: vcenters is required once set and must have at least 1
1101+
item
1102+
rule: 'has(oldSelf.vsphere) && has(oldSelf.vsphere.vcenters) ? (has(self.vsphere)
1103+
&& has(self.vsphere.vcenters) && size(self.vsphere.vcenters) >
1104+
0) : true'
1105+
- message: vcenters must have at least 1 item when initially configured
1106+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1107+
? size(self.vsphere.vcenters) > 0 : true'
11031108
type: object
11041109
status:
11051110
description: status holds observed values from the cluster. They may not

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,14 +1026,11 @@ spec:
10261026
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
10271027
- message: ingressIPs list is required once set
10281028
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1029-
- message: vcenters can have at most 1 item when configured post-install
1030-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1031-
< 2 : true'
10321029
type: object
10331030
x-kubernetes-validations:
10341031
- message: vcenters can have at most 1 item when configured post-install
1035-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1036-
< 2 : true'
1032+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1033+
? size(self.vsphere.vcenters) < 2 : true'
10371034
type: object
10381035
status:
10391036
description: status holds observed values from the cluster. They may not

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,14 +1092,11 @@ spec:
10921092
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
10931093
- message: ingressIPs list is required once set
10941094
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1095-
- message: vcenters can have at most 1 item when configured post-install
1096-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1097-
< 2 : true'
10981095
type: object
10991096
x-kubernetes-validations:
11001097
- message: vcenters can have at most 1 item when configured post-install
1101-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1102-
< 2 : true'
1098+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1099+
? size(self.vsphere.vcenters) < 2 : true'
11031100
type: object
11041101
status:
11051102
description: status holds observed values from the cluster. They may not

config/v1/zz_generated.featuregated-crd-manifests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ infrastructures.config.openshift.io:
377377
- OnPremDNSRecords
378378
- VSphereHostVMGroupZonal
379379
- VSphereMultiNetworks
380+
- VSphereMultiVCenterDay2
380381
FilenameOperatorName: config-operator
381382
FilenameOperatorOrdering: "01"
382383
FilenameRunLevel: "0000_10"

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -999,18 +999,18 @@ spec:
999999
&& size(self) < 2 : true'
10001000
type: object
10011001
x-kubernetes-validations:
1002+
- message: vcenters can have at most 1 item when configured post-install
1003+
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1004+
< 2 : true'
10021005
- message: apiServerInternalIPs list is required once set
10031006
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
10041007
- message: ingressIPs list is required once set
10051008
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1006-
- message: vcenters can have at most 1 item when configured post-install
1007-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1008-
< 2 : true'
10091009
type: object
10101010
x-kubernetes-validations:
10111011
- message: vcenters can have at most 1 item when configured post-install
1012-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1013-
< 2 : true'
1012+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1013+
? size(self.vsphere.vcenters) < 2 : true'
10141014
type: object
10151015
status:
10161016
description: status holds observed values from the cluster. They may not

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/AWSClusterHostedDNSInstall.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -991,24 +991,13 @@ spec:
991991
minItems: 0
992992
type: array
993993
x-kubernetes-list-type: atomic
994-
x-kubernetes-validations:
995-
- message: vcenters cannot be added or removed once set
996-
rule: 'size(self) != size(oldSelf) ? size(oldSelf) == 0
997-
&& size(self) < 2 : true'
998994
type: object
999995
x-kubernetes-validations:
1000996
- message: apiServerInternalIPs list is required once set
1001997
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
1002998
- message: ingressIPs list is required once set
1003999
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1004-
- message: vcenters can have at most 1 item when configured post-install
1005-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1006-
< 2 : true'
10071000
type: object
1008-
x-kubernetes-validations:
1009-
- message: vcenters can have at most 1 item when configured post-install
1010-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1011-
< 2 : true'
10121001
type: object
10131002
status:
10141003
description: status holds observed values from the cluster. They may not

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/AWSDualStackInstall.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -991,24 +991,13 @@ spec:
991991
minItems: 0
992992
type: array
993993
x-kubernetes-list-type: atomic
994-
x-kubernetes-validations:
995-
- message: vcenters cannot be added or removed once set
996-
rule: 'size(self) != size(oldSelf) ? size(oldSelf) == 0
997-
&& size(self) < 2 : true'
998994
type: object
999995
x-kubernetes-validations:
1000996
- message: apiServerInternalIPs list is required once set
1001997
rule: '!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)'
1002998
- message: ingressIPs list is required once set
1003999
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
1004-
- message: vcenters can have at most 1 item when configured post-install
1005-
rule: '!has(oldSelf.vcenters) && has(self.vcenters) ? size(self.vcenters)
1006-
< 2 : true'
10071000
type: object
1008-
x-kubernetes-validations:
1009-
- message: vcenters can have at most 1 item when configured post-install
1010-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1011-
< 2 : true'
10121001
type: object
10131002
status:
10141003
description: status holds observed values from the cluster. They may not

0 commit comments

Comments
 (0)