From 1b1f9868fc58926e388f603aae129c4a11326fe7 Mon Sep 17 00:00:00 2001 From: Richard Vanderpool <49568690+rvanderp3@users.noreply.github.com> Date: Thu, 18 Jan 2024 11:46:07 -0500 Subject: [PATCH] promote feature gate and vSphere failure domains to default --- config/v1/types_feature.go | 2 +- ...trolplanemachineset-CustomNoUpgrade.crd.yaml | 7 +++++-- ...0_10_controlplanemachineset-Default.crd.yaml | 17 +++++++++++++++++ ...lanemachineset-TechPreviewNoUpgrade.crd.yaml | 7 +++++-- machine/v1/types_controlplanemachineset.go | 5 +++-- .../generated_openapi/zz_generated.openapi.go | 8 ++++++++ openapi/openapi.json | 6 +++++- .../featuregates/featureGate-Default.yaml | 6 +++--- .../featureGate-LatencySensitive.yaml | 6 +++--- 9 files changed, 50 insertions(+), 14 deletions(-) diff --git a/config/v1/types_feature.go b/config/v1/types_feature.go index 8088cc40032..b5352c4ff9c 100644 --- a/config/v1/types_feature.go +++ b/config/v1/types_feature.go @@ -180,7 +180,6 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{ with(vSphereStaticIPs). with(routeExternalCertificate). with(automatedEtcdBackup). - with(vSphereControlPlaneMachineset). without(machineAPIOperatorDisableMachineHealthCheckController). with(adminNetworkPolicy). with(dnsNameResolver). @@ -214,6 +213,7 @@ var defaultFeatures = &FeatureGateEnabledDisabled{ privateHostedZoneAWS, buildCSIVolumes, kmsv1, + vSphereControlPlaneMachineset, }, Disabled: []FeatureGateDescription{ disableKubeletCloudCredentialProviders, // We do not currently ship the correct config to use the external credentials provider. diff --git a/machine/v1/0000_10_controlplanemachineset-CustomNoUpgrade.crd.yaml b/machine/v1/0000_10_controlplanemachineset-CustomNoUpgrade.crd.yaml index 61f84a389d5..1d1ac1eb8b9 100644 --- a/machine/v1/0000_10_controlplanemachineset-CustomNoUpgrade.crd.yaml +++ b/machine/v1/0000_10_controlplanemachineset-CustomNoUpgrade.crd.yaml @@ -335,9 +335,10 @@ spec: name: description: name of the failure domain in which the vSphere machine provider will create the VM. Failure domains are defined in a cluster's config.openshift.io/Infrastructure resource. When balancing machines across failure domains, the control plane machine set will inject configuration from the Infrastructure resource into the machine providerSpec to allocate the machine to a failure domain. type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map x-kubernetes-validations: - - rule: 'has(self.platform) && self.platform == ''VSphere'' ? has(self.vsphere) : !has(self.vsphere)' - message: vsphere configuration is required when platform is VSphere, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''AWS'' ? has(self.aws) : !has(self.aws)' message: aws configuration is required when platform is AWS, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''Azure'' ? has(self.azure) : !has(self.azure)' @@ -346,6 +347,8 @@ spec: message: gcp configuration is required when platform is GCP, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''OpenStack'' ? has(self.openstack) : !has(self.openstack)' message: openstack configuration is required when platform is OpenStack, and forbidden otherwise + - rule: 'has(self.platform) && self.platform == ''VSphere'' ? has(self.vsphere) : !has(self.vsphere)' + message: vsphere configuration is required when platform is VSphere, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''Nutanix'' ? has(self.nutanix) : !has(self.nutanix)' message: nutanix configuration is required when platform is Nutanix, and forbidden otherwise metadata: diff --git a/machine/v1/0000_10_controlplanemachineset-Default.crd.yaml b/machine/v1/0000_10_controlplanemachineset-Default.crd.yaml index 906aca90d73..728b1c27614 100644 --- a/machine/v1/0000_10_controlplanemachineset-Default.crd.yaml +++ b/machine/v1/0000_10_controlplanemachineset-Default.crd.yaml @@ -323,6 +323,21 @@ spec: - AlibabaCloud - Nutanix - External + vsphere: + description: vsphere configures failure domain information for the VSphere platform. + type: array + items: + description: VSphereFailureDomain configures failure domain information for the vSphere platform + type: object + required: + - name + properties: + name: + description: name of the failure domain in which the vSphere machine provider will create the VM. Failure domains are defined in a cluster's config.openshift.io/Infrastructure resource. When balancing machines across failure domains, the control plane machine set will inject configuration from the Infrastructure resource into the machine providerSpec to allocate the machine to a failure domain. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map x-kubernetes-validations: - rule: 'has(self.platform) && self.platform == ''AWS'' ? has(self.aws) : !has(self.aws)' message: aws configuration is required when platform is AWS, and forbidden otherwise @@ -332,6 +347,8 @@ spec: message: gcp configuration is required when platform is GCP, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''OpenStack'' ? has(self.openstack) : !has(self.openstack)' message: openstack configuration is required when platform is OpenStack, and forbidden otherwise + - rule: 'has(self.platform) && self.platform == ''VSphere'' ? has(self.vsphere) : !has(self.vsphere)' + message: vsphere configuration is required when platform is VSphere, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''Nutanix'' ? has(self.nutanix) : !has(self.nutanix)' message: nutanix configuration is required when platform is Nutanix, and forbidden otherwise metadata: diff --git a/machine/v1/0000_10_controlplanemachineset-TechPreviewNoUpgrade.crd.yaml b/machine/v1/0000_10_controlplanemachineset-TechPreviewNoUpgrade.crd.yaml index 442ae307a2f..b4d24f8df6c 100644 --- a/machine/v1/0000_10_controlplanemachineset-TechPreviewNoUpgrade.crd.yaml +++ b/machine/v1/0000_10_controlplanemachineset-TechPreviewNoUpgrade.crd.yaml @@ -335,9 +335,10 @@ spec: name: description: name of the failure domain in which the vSphere machine provider will create the VM. Failure domains are defined in a cluster's config.openshift.io/Infrastructure resource. When balancing machines across failure domains, the control plane machine set will inject configuration from the Infrastructure resource into the machine providerSpec to allocate the machine to a failure domain. type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map x-kubernetes-validations: - - rule: 'has(self.platform) && self.platform == ''VSphere'' ? has(self.vsphere) : !has(self.vsphere)' - message: vsphere configuration is required when platform is VSphere, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''AWS'' ? has(self.aws) : !has(self.aws)' message: aws configuration is required when platform is AWS, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''Azure'' ? has(self.azure) : !has(self.azure)' @@ -346,6 +347,8 @@ spec: message: gcp configuration is required when platform is GCP, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''OpenStack'' ? has(self.openstack) : !has(self.openstack)' message: openstack configuration is required when platform is OpenStack, and forbidden otherwise + - rule: 'has(self.platform) && self.platform == ''VSphere'' ? has(self.vsphere) : !has(self.vsphere)' + message: vsphere configuration is required when platform is VSphere, and forbidden otherwise - rule: 'has(self.platform) && self.platform == ''Nutanix'' ? has(self.nutanix) : !has(self.nutanix)' message: nutanix configuration is required when platform is Nutanix, and forbidden otherwise metadata: diff --git a/machine/v1/types_controlplanemachineset.go b/machine/v1/types_controlplanemachineset.go index 42e2b83fa1c..c31926f0c9e 100644 --- a/machine/v1/types_controlplanemachineset.go +++ b/machine/v1/types_controlplanemachineset.go @@ -231,7 +231,7 @@ const ( // +kubebuilder:validation:XValidation:rule="has(self.platform) && self.platform == 'Azure' ? has(self.azure) : !has(self.azure)",message="azure configuration is required when platform is Azure, and forbidden otherwise" // +kubebuilder:validation:XValidation:rule="has(self.platform) && self.platform == 'GCP' ? has(self.gcp) : !has(self.gcp)",message="gcp configuration is required when platform is GCP, and forbidden otherwise" // +kubebuilder:validation:XValidation:rule="has(self.platform) && self.platform == 'OpenStack' ? has(self.openstack) : !has(self.openstack)",message="openstack configuration is required when platform is OpenStack, and forbidden otherwise" -// +openshift:validation:FeatureSetAwareXValidation:featureSet=CustomNoUpgrade;TechPreviewNoUpgrade,rule="has(self.platform) && self.platform == 'VSphere' ? has(self.vsphere) : !has(self.vsphere)",message="vsphere configuration is required when platform is VSphere, and forbidden otherwise" +// +kubebuilder:validation:XValidation:rule="has(self.platform) && self.platform == 'VSphere' ? has(self.vsphere) : !has(self.vsphere)",message="vsphere configuration is required when platform is VSphere, and forbidden otherwise" // +kubebuilder:validation:XValidation:rule="has(self.platform) && self.platform == 'Nutanix' ? has(self.nutanix) : !has(self.nutanix)",message="nutanix configuration is required when platform is Nutanix, and forbidden otherwise" type FailureDomains struct { // Platform identifies the platform for which the FailureDomain represents. @@ -253,8 +253,9 @@ type FailureDomains struct { GCP *[]GCPFailureDomain `json:"gcp,omitempty"` // vsphere configures failure domain information for the VSphere platform. + // +listType=map + // +listMapKey=name // +optional - // +openshift:enable:FeatureSets=CustomNoUpgrade;TechPreviewNoUpgrade VSphere []VSphereFailureDomain `json:"vsphere,omitempty"` // OpenStack configures failure domain information for the OpenStack platform. diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index b42c27c454d..6973900b4f9 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -32577,6 +32577,14 @@ func schema_openshift_api_machine_v1_FailureDomains(ref common.ReferenceCallback }, }, "vsphere": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, SchemaProps: spec.SchemaProps{ Description: "vsphere configures failure domain information for the VSphere platform.", Type: []string{"array"}, diff --git a/openapi/openapi.json b/openapi/openapi.json index a9e90467587..c6486c77ab7 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -18866,7 +18866,11 @@ "items": { "default": {}, "$ref": "#/definitions/com.github.openshift.api.machine.v1.VSphereFailureDomain" - } + }, + "x-kubernetes-list-map-keys": [ + "name" + ], + "x-kubernetes-list-type": "map" } }, "x-kubernetes-unions": [ diff --git a/payload-manifests/featuregates/featureGate-Default.yaml b/payload-manifests/featuregates/featureGate-Default.yaml index 044742f432d..74660679f91 100644 --- a/payload-manifests/featuregates/featureGate-Default.yaml +++ b/payload-manifests/featuregates/featureGate-Default.yaml @@ -94,9 +94,6 @@ { "name": "UpgradeStatus" }, - { - "name": "VSphereControlPlaneMachineSet" - }, { "name": "VSphereStaticIPs" }, @@ -137,6 +134,9 @@ }, { "name": "PrivateHostedZoneAWS" + }, + { + "name": "VSphereControlPlaneMachineSet" } ], "version": "" diff --git a/payload-manifests/featuregates/featureGate-LatencySensitive.yaml b/payload-manifests/featuregates/featureGate-LatencySensitive.yaml index 16bb0f11ae8..e23f217a0f5 100644 --- a/payload-manifests/featuregates/featureGate-LatencySensitive.yaml +++ b/payload-manifests/featuregates/featureGate-LatencySensitive.yaml @@ -96,9 +96,6 @@ { "name": "UpgradeStatus" }, - { - "name": "VSphereControlPlaneMachineSet" - }, { "name": "VSphereStaticIPs" }, @@ -139,6 +136,9 @@ }, { "name": "PrivateHostedZoneAWS" + }, + { + "name": "VSphereControlPlaneMachineSet" } ], "version": ""