Skip to content

Commit 76d9af3

Browse files
committed
Added vSphere Day 2 logic to CRDs
1 parent 96f1f5a commit 76d9af3

File tree

50 files changed

+5029
-393
lines changed

Some content is hidden

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

50 files changed

+5029
-393
lines changed

config/v1/types_infrastructure.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ 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) ? 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(self.vsphere) ? size(self.vsphere.vcenters) > 0 : true",message="vcenters must have at least 1 item"
299300
type PlatformSpec struct {
300301
// type is the underlying infrastructure provider for the cluster. This
301302
// value controls whether infrastructure automation such as service load
@@ -1642,7 +1643,8 @@ type VSpherePlatformNodeNetworking struct {
16421643
// use these fields for configuration.
16431644
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set"
16441645
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
1645-
// +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.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters) > 0 : true",message="vcenters must have at least 1 item"
16461648
type VSpherePlatformSpec struct {
16471649
// vcenters holds the connection details for services to communicate with vCenter.
16481650
// Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
@@ -1656,7 +1658,8 @@ type VSpherePlatformSpec struct {
16561658
// + in openshift-config.
16571659
// +kubebuilder:validation:MinItems=0
16581660
// +kubebuilder:validation:MaxItems=3
1659-
// +kubebuilder:validation:XValidation:rule="size(self) != size(oldSelf) ? size(oldSelf) == 0 && size(self) < 2 : true",message="vcenters cannot be added or removed once set"
1661+
// +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"
1662+
// +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="!has(oldSelf.vsphere) && has(self.vsphere) ? size(self) > 0 : true",message="vcenters must have at least 1 item"
16601663
// +listType=atomic
16611664
// +optional
16621665
VCenters []VSpherePlatformVCenterSpec `json:"vcenters,omitempty"`

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,23 +1083,23 @@ 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: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self)
1088+
> 0 : true'
10891089
type: object
10901090
x-kubernetes-validations:
1091+
- message: vcenters must have at least 1 item
1092+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1093+
> 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
1100+
- message: vcenters must have at least 1 item
11011101
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? size(self.vsphere.vcenters)
1102-
< 2 : true'
1102+
> 0 : true'
11031103
type: object
11041104
status:
11051105
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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,6 @@ 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

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,6 @@ 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

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,6 @@ 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

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,6 @@ 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

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

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -999,13 +999,13 @@ 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

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)