-
Notifications
You must be signed in to change notification settings - Fork 602
SPLAT-2649: Added vSphere Day 2 logic to CRDs #2784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,7 +295,9 @@ type ExternalPlatformSpec struct { | |
| // PlatformSpec holds the desired state specific to the underlying infrastructure provider | ||
| // of the current cluster. Since these are used at spec-level for the underlying cluster, it | ||
| // is supposed that only one of the spec structs is set. | ||
| // +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" | ||
| // +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" | ||
| // +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" | ||
| // +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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be a breaking change to set the Anyone who has somehow persisted
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory it isn't a breaking change. I think the issue I hit was more of a unit test. I'll make sure that we still catch someone trying to create an empty list. |
||
| type PlatformSpec struct { | ||
| // type is the underlying infrastructure provider for the cluster. This | ||
| // value controls whether infrastructure automation such as service load | ||
|
|
@@ -1641,21 +1643,22 @@ type VSpherePlatformNodeNetworking struct { | |
| // use these fields for configuration. | ||
| // +kubebuilder:validation:XValidation:rule="!has(oldSelf.apiServerInternalIPs) || has(self.apiServerInternalIPs)",message="apiServerInternalIPs list is required once set" | ||
| // +kubebuilder:validation:XValidation:rule="!has(oldSelf.ingressIPs) || has(self.ingressIPs)",message="ingressIPs list is required once set" | ||
| // +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" | ||
| type VSpherePlatformSpec struct { | ||
| // vcenters holds the connection details for services to communicate with vCenter. | ||
| // Currently, only a single vCenter is supported, but in tech preview 3 vCenters are supported. | ||
| // Currently, up to 3 vCenters are supported. | ||
| // Once the cluster has been installed, you are unable to change the current number of defined | ||
| // vCenters except in the case where the cluster has been upgraded from a version of OpenShift | ||
| // where the vsphere platform spec was not present. You may make modifications to the existing | ||
| // vCenters except when 1.) the cluster has been upgraded from a version of OpenShift | ||
| // where the vsphere platform spec was not present or 2.) in TechPreview you are able to add and | ||
| // remove vCenters but may not remove all vCenters. You may make modifications to the existing | ||
| // vCenters that are defined in the vcenters list in order to match with any added or modified | ||
| // failure domains. | ||
| // --- | ||
| // + If VCenters is not defined use the existing cloud-config configmap defined | ||
| // + in openshift-config. | ||
| // +kubebuilder:validation:MinItems=0 | ||
| // +kubebuilder:validation:MaxItems=3 | ||
| // +kubebuilder:validation:XValidation:rule="size(self) != size(oldSelf) ? size(oldSelf) == 0 && size(self) < 2 : true",message="vcenters cannot be added or removed once set" | ||
| // +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" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I completely change the configuration of the vcenter, but keep the number the same, is that ok? Effectively like adding an item to the list, then removing the old item, but in one transaction?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting. that would be be ok now going forward since we'll be cleaning up older configs from the cloud config via the other PRs; however, the older releases this would not be allowed. Its the configuration of vcenters in the ini / yaml file that we are protecting. Older cluster installs (before multi vcenter was introduced) had ini files and that only allowed 1 vcenter. Newer installs now leverage YAML cloud config and we can configure more than 1. So even replacing the existing one w/ a new one will invalidate the INI file and cluster will be in bad shape. |
||
| // +openshift:validation:FeatureGateAwareXValidation:featureGate=VSphereMultiVCenterDay2,rule="size(self) != size(oldSelf) ? size(self) > 0 : true",message="vcenters must have at least 1 item" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can avoid this if we just make MinItems 1 right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. the response message will change due to using basic validation, but that shouldn't be an issue. I"ll update the unit tests. |
||
| // +listType=atomic | ||
| // +optional | ||
| VCenters []VSpherePlatformVCenterSpec `json:"vcenters,omitempty"` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally equivalent but more succinct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update that.