Skip to content

Commit 45bd3b5

Browse files
committed
Modified parent logic to not check size, but only changes in existence.
1 parent b441104 commit 45bd3b5

50 files changed

Lines changed: 373 additions & 247 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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +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-
// +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"
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)) : true",message="vcenters is required once set and cannot be removed"
301300
type PlatformSpec struct {
302301
// type is the underlying infrastructure provider for the cluster. This
303302
// value controls whether infrastructure automation such as service load
@@ -1645,10 +1644,11 @@ type VSpherePlatformNodeNetworking struct {
16451644
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set"
16461645
type VSpherePlatformSpec struct {
16471646
// vcenters holds the connection details for services to communicate with vCenter.
1648-
// Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
1647+
// Currently, up to 3 vCenters are supported.
16491648
// Once the cluster has been installed, you are unable to change the current number of defined
1650-
// vCenters except in the case where the cluster has been upgraded from a version of OpenShift
1651-
// where the vsphere platform spec was not present. You may make modifications to the existing
1649+
// vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
1650+
// where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
1651+
// remove vCenters but may not remove all vCenters. You may make modifications to the existing
16521652
// vCenters that are defined in the vcenters list in order to match with any added or modified
16531653
// failure domains.
16541654
// ---

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,11 @@ spec:
10311031
vcenters:
10321032
description: |-
10331033
vcenters holds the connection details for services to communicate with vCenter.
1034-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
1034+
Currently, up to 3 vCenters are supported.
10351035
Once the cluster has been installed, you are unable to change the current number of defined
1036-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
1037-
where the vsphere platform spec was not present. You may make modifications to the existing
1036+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
1037+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
1038+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
10381039
vCenters that are defined in the vcenters list in order to match with any added or modified
10391040
failure domains.
10401041
items:
@@ -1093,14 +1094,9 @@ spec:
10931094
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
10941095
type: object
10951096
x-kubernetes-validations:
1096-
- message: vcenters is required once set and must have at least 1
1097-
item
1097+
- message: vcenters is required once set and cannot be removed
10981098
rule: 'has(oldSelf.vsphere) && has(oldSelf.vsphere.vcenters) ? (has(self.vsphere)
1099-
&& has(self.vsphere.vcenters) && size(self.vsphere.vcenters) >
1100-
0) : true'
1101-
- message: vcenters must have at least 1 item when initially configured
1102-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1103-
? size(self.vsphere.vcenters) > 0 : true'
1099+
&& has(self.vsphere.vcenters)) : true'
11041100
type: object
11051101
status:
11061102
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,11 @@ spec:
965965
vcenters:
966966
description: |-
967967
vcenters holds the connection details for services to communicate with vCenter.
968-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
968+
Currently, up to 3 vCenters are supported.
969969
Once the cluster has been installed, you are unable to change the current number of defined
970-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
971-
where the vsphere platform spec was not present. You may make modifications to the existing
970+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
971+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
972+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
972973
vCenters that are defined in the vcenters list in order to match with any added or modified
973974
failure domains.
974975
items:
@@ -1029,8 +1030,8 @@ spec:
10291030
type: object
10301031
x-kubernetes-validations:
10311032
- message: vcenters can have at most 1 item when configured post-install
1032-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1033-
? size(self.vsphere.vcenters) < 2 : true'
1033+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters)
1034+
&& size(self.vsphere.vcenters) < 2) : true'
10341035
type: object
10351036
status:
10361037
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: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,11 @@ spec:
10311031
vcenters:
10321032
description: |-
10331033
vcenters holds the connection details for services to communicate with vCenter.
1034-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
1034+
Currently, up to 3 vCenters are supported.
10351035
Once the cluster has been installed, you are unable to change the current number of defined
1036-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
1037-
where the vsphere platform spec was not present. You may make modifications to the existing
1036+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
1037+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
1038+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
10381039
vCenters that are defined in the vcenters list in order to match with any added or modified
10391040
failure domains.
10401041
items:
@@ -1093,14 +1094,9 @@ spec:
10931094
rule: '!has(oldSelf.ingressIPs) || has(self.ingressIPs)'
10941095
type: object
10951096
x-kubernetes-validations:
1096-
- message: vcenters is required once set and must have at least 1
1097-
item
1097+
- message: vcenters is required once set and cannot be removed
10981098
rule: 'has(oldSelf.vsphere) && has(oldSelf.vsphere.vcenters) ? (has(self.vsphere)
1099-
&& has(self.vsphere.vcenters) && size(self.vsphere.vcenters) >
1100-
0) : true'
1101-
- message: vcenters must have at least 1 item when initially configured
1102-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1103-
? size(self.vsphere.vcenters) > 0 : true'
1099+
&& has(self.vsphere.vcenters)) : true'
11041100
type: object
11051101
status:
11061102
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,11 @@ spec:
965965
vcenters:
966966
description: |-
967967
vcenters holds the connection details for services to communicate with vCenter.
968-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
968+
Currently, up to 3 vCenters are supported.
969969
Once the cluster has been installed, you are unable to change the current number of defined
970-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
971-
where the vsphere platform spec was not present. You may make modifications to the existing
970+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
971+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
972+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
972973
vCenters that are defined in the vcenters list in order to match with any added or modified
973974
failure domains.
974975
items:
@@ -1029,8 +1030,8 @@ spec:
10291030
type: object
10301031
x-kubernetes-validations:
10311032
- message: vcenters can have at most 1 item when configured post-install
1032-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1033-
? size(self.vsphere.vcenters) < 2 : true'
1033+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters)
1034+
&& size(self.vsphere.vcenters) < 2) : true'
10341035
type: object
10351036
status:
10361037
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,11 @@ spec:
10311031
vcenters:
10321032
description: |-
10331033
vcenters holds the connection details for services to communicate with vCenter.
1034-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
1034+
Currently, up to 3 vCenters are supported.
10351035
Once the cluster has been installed, you are unable to change the current number of defined
1036-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
1037-
where the vsphere platform spec was not present. You may make modifications to the existing
1036+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
1037+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
1038+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
10381039
vCenters that are defined in the vcenters list in order to match with any added or modified
10391040
failure domains.
10401041
items:
@@ -1095,8 +1096,8 @@ spec:
10951096
type: object
10961097
x-kubernetes-validations:
10971098
- message: vcenters can have at most 1 item when configured post-install
1098-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1099-
? size(self.vsphere.vcenters) < 2 : true'
1099+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters)
1100+
&& size(self.vsphere.vcenters) < 2) : true'
11001101
type: object
11011102
status:
11021103
description: status holds observed values from the cluster. They may not

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -946,10 +946,11 @@ spec:
946946
vcenters:
947947
description: |-
948948
vcenters holds the connection details for services to communicate with vCenter.
949-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
949+
Currently, up to 3 vCenters are supported.
950950
Once the cluster has been installed, you are unable to change the current number of defined
951-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
952-
where the vsphere platform spec was not present. You may make modifications to the existing
951+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
952+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
953+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
953954
vCenters that are defined in the vcenters list in order to match with any added or modified
954955
failure domains.
955956
items:
@@ -1006,8 +1007,8 @@ spec:
10061007
type: object
10071008
x-kubernetes-validations:
10081009
- message: vcenters can have at most 1 item when configured post-install
1009-
rule: '!has(oldSelf.vsphere) && has(self.vsphere) && has(self.vsphere.vcenters)
1010-
? size(self.vsphere.vcenters) < 2 : true'
1010+
rule: '!has(oldSelf.vsphere) && has(self.vsphere) ? (has(self.vsphere.vcenters)
1011+
&& size(self.vsphere.vcenters) < 2) : true'
10111012
type: object
10121013
status:
10131014
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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,11 @@ spec:
944944
vcenters:
945945
description: |-
946946
vcenters holds the connection details for services to communicate with vCenter.
947-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
947+
Currently, up to 3 vCenters are supported.
948948
Once the cluster has been installed, you are unable to change the current number of defined
949-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
950-
where the vsphere platform spec was not present. You may make modifications to the existing
949+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
950+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
951+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
951952
vCenters that are defined in the vcenters list in order to match with any added or modified
952953
failure domains.
953954
items:

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,11 @@ spec:
944944
vcenters:
945945
description: |-
946946
vcenters holds the connection details for services to communicate with vCenter.
947-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
947+
Currently, up to 3 vCenters are supported.
948948
Once the cluster has been installed, you are unable to change the current number of defined
949-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
950-
where the vsphere platform spec was not present. You may make modifications to the existing
949+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
950+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
951+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
951952
vCenters that are defined in the vcenters list in order to match with any added or modified
952953
failure domains.
953954
items:

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,10 +944,11 @@ spec:
944944
vcenters:
945945
description: |-
946946
vcenters holds the connection details for services to communicate with vCenter.
947-
Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported.
947+
Currently, up to 3 vCenters are supported.
948948
Once the cluster has been installed, you are unable to change the current number of defined
949-
vCenters except in the case where the cluster has been upgraded from a version of OpenShift
950-
where the vsphere platform spec was not present. You may make modifications to the existing
949+
vCenters except when 1.) the cluster has been upgraded from a version of OpenShift
950+
where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and
951+
remove vCenters but may not remove all vCenters. You may make modifications to the existing
951952
vCenters that are defined in the vcenters list in order to match with any added or modified
952953
failure domains.
953954
items:

0 commit comments

Comments
 (0)