From 0321c419435cc5cb70547818214ee3d994244638 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Mon, 24 Apr 2023 15:34:11 -0400 Subject: [PATCH] OSASINFRA-3153: move `loadBalancer` API to GA for OpenStack This API has not moved and there is no plan to make any change that would be backward incompatible in the future. The feature was well tested (and automated) by our QE on this platform, as well documented on OCP 4.13. We think this API is ready to be GA'ed. --- .../install.openshift.io_installconfigs.yaml | 2 +- pkg/types/openstack/platform.go | 1 - pkg/types/openstack/validation/techpreview.go | 4 -- .../openstack/validation/techpreview_test.go | 39 ------------------- pkg/types/validation/installconfig_test.go | 14 ------- .../install-config.yaml | 32 --------------- .../test_cluster-infra.py | 30 -------------- .../lb-managed/install-config.yaml | 1 - .../lb-unmanaged/install-config.yaml | 1 - 9 files changed, 1 insertion(+), 123 deletions(-) delete mode 100644 pkg/types/openstack/validation/techpreview_test.go delete mode 100644 scripts/openstack/manifest-tests/lb-default-techpreview/install-config.yaml delete mode 100755 scripts/openstack/manifest-tests/lb-default-techpreview/test_cluster-infra.py diff --git a/data/data/install.openshift.io_installconfigs.yaml b/data/data/install.openshift.io_installconfigs.yaml index aab1a5e045..c3fa386b8d 100644 --- a/data/data/install.openshift.io_installconfigs.yaml +++ b/data/data/install.openshift.io_installconfigs.yaml @@ -3610,7 +3610,7 @@ spec: type: string loadBalancer: description: LoadBalancer defines how the load balancer used by - the cluster is configured. LoadBalancer is available in TechPreview. + the cluster is configured. properties: type: default: OpenShiftManagedDefault diff --git a/pkg/types/openstack/platform.go b/pkg/types/openstack/platform.go index fe06190e55..b70b3e4836 100644 --- a/pkg/types/openstack/platform.go +++ b/pkg/types/openstack/platform.go @@ -120,7 +120,6 @@ type Platform struct { MachinesSubnet string `json:"machinesSubnet,omitempty"` // LoadBalancer defines how the load balancer used by the cluster is configured. - // LoadBalancer is available in TechPreview. // +optional LoadBalancer *configv1.OpenStackPlatformLoadBalancer `json:"loadBalancer,omitempty"` } diff --git a/pkg/types/openstack/validation/techpreview.go b/pkg/types/openstack/validation/techpreview.go index a614932ecb..c3ce4244c0 100644 --- a/pkg/types/openstack/validation/techpreview.go +++ b/pkg/types/openstack/validation/techpreview.go @@ -14,10 +14,6 @@ func FilledInTechPreviewFields(installConfig *types.InstallConfig) (fields []*fi return nil } - if installConfig.OpenStack.LoadBalancer != nil { - fields = append(fields, field.NewPath("platform", "openstack", "loadBalancer")) - } - if installConfig.ControlPlane != nil && installConfig.ControlPlane.Platform.OpenStack != nil && len(installConfig.ControlPlane.Platform.OpenStack.FailureDomains) > 0 { fields = append(fields, field.NewPath("controlPlane", "platform", "openstack", "failureDomains")) } diff --git a/pkg/types/openstack/validation/techpreview_test.go b/pkg/types/openstack/validation/techpreview_test.go deleted file mode 100644 index 4202a5ef4b..0000000000 --- a/pkg/types/openstack/validation/techpreview_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package validation - -import ( - "testing" - - "k8s.io/apimachinery/pkg/util/validation/field" - - v1 "github.com/openshift/api/config/v1" - "github.com/openshift/installer/pkg/types" - "github.com/openshift/installer/pkg/types/openstack" -) - -func TestFilledInTechPreviewFields(t *testing.T) { - t.Run("load_balancer", func(t *testing.T) { - installConfig := types.InstallConfig{ - Platform: types.Platform{ - OpenStack: &openstack.Platform{ - LoadBalancer: &v1.OpenStackPlatformLoadBalancer{ - Type: v1.LoadBalancerTypeUserManaged, - }, - }, - }, - } - - expectedField := field.NewPath("platform", "openstack", "loadBalancer") - - var found bool - - for _, f := range FilledInTechPreviewFields(&installConfig) { - if f.String() == expectedField.String() { - found = true - break - } - } - if !found { - t.Errorf("expected field %q to be detected", expectedField) - } - }) -} diff --git a/pkg/types/validation/installconfig_test.go b/pkg/types/validation/installconfig_test.go index 611600047c..b95e670306 100644 --- a/pkg/types/validation/installconfig_test.go +++ b/pkg/types/validation/installconfig_test.go @@ -2028,20 +2028,6 @@ func TestValidateInstallConfig(t *testing.T) { }(), expectedError: "platform.openstack.apiVIPs: Invalid value: \"foobar\": \"foobar\" is not a valid IP", }, - { - name: "should reject load balancer on OpenStack if not TechPreviewNoUpgrade", - installConfig: func() *types.InstallConfig { - c := validInstallConfig() - c.Platform = types.Platform{ - OpenStack: validOpenStackPlatform(), - } - c.Platform.OpenStack.LoadBalancer = &configv1.OpenStackPlatformLoadBalancer{ - Type: configv1.LoadBalancerTypeOpenShiftManagedDefault, - } - return c - }(), - expectedError: `platform.openstack.loadBalancer: Forbidden: the TechPreviewNoUpgrade feature set must be enabled to use this field`, - }, { name: "should not validate vips on VSphere if not set (vips are not required on VSphere)", installConfig: func() *types.InstallConfig { diff --git a/scripts/openstack/manifest-tests/lb-default-techpreview/install-config.yaml b/scripts/openstack/manifest-tests/lb-default-techpreview/install-config.yaml deleted file mode 100644 index d7d8f591a0..0000000000 --- a/scripts/openstack/manifest-tests/lb-default-techpreview/install-config.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -baseDomain: shiftstack.example.com -controlPlane: - hyperthreading: Enabled - architecture: amd64 - name: master - platform: - openstack: - type: ${COMPUTE_FLAVOR} - replicas: 3 -compute: -- name: worker - platform: - openstack: - type: ${COMPUTE_FLAVOR} - replicas: 3 -metadata: - name: manifests1 -networking: - clusterNetwork: - - cidr: 10.128.0.0/14 - hostPrefix: 23 - machineNetwork: - - cidr: 10.0.128.0/17 - networkType: OVNKubernetes - serviceNetwork: - - 172.30.0.0/16 -platform: - openstack: - cloud: ${OS_CLOUD} -featureSet: TechPreviewNoUpgrade -pullSecret: ${PULL_SECRET} diff --git a/scripts/openstack/manifest-tests/lb-default-techpreview/test_cluster-infra.py b/scripts/openstack/manifest-tests/lb-default-techpreview/test_cluster-infra.py deleted file mode 100755 index c4503ba3e8..0000000000 --- a/scripts/openstack/manifest-tests/lb-default-techpreview/test_cluster-infra.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import unittest -import xmlrunner - -import os -import sys -import glob -import yaml - -ASSETS_DIR = "" - -class DefaultTechPreviewLoadBalancerClusterInfraObject(unittest.TestCase): - def setUp(self): - """Parse the Cluster Infrastructure object into a Python data structure.""" - self.machines = [] - cluster_infra = f'{ASSETS_DIR}/manifests/cluster-infrastructure-02-config.yml' - with open(cluster_infra) as f: - self.cluster_infra = yaml.load(f, Loader=yaml.FullLoader) - - def test_load_balancer(self): - """Assert that the Cluster infrastructure object does not contain the LoadBalancer configuration.""" - self.assertNotIn("loadBalancer", self.cluster_infra["status"]["platformStatus"]["openstack"]) - - -if __name__ == '__main__': - ASSETS_DIR = sys.argv.pop() - with open(os.environ.get('JUNIT_FILE', '/dev/null'), 'wb') as output: - unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), failfast=False, buffer=False, catchbreak=False, verbosity=2) diff --git a/scripts/openstack/manifest-tests/lb-managed/install-config.yaml b/scripts/openstack/manifest-tests/lb-managed/install-config.yaml index 6aa00a0ea2..e781cc115a 100644 --- a/scripts/openstack/manifest-tests/lb-managed/install-config.yaml +++ b/scripts/openstack/manifest-tests/lb-managed/install-config.yaml @@ -30,5 +30,4 @@ platform: cloud: ${OS_CLOUD} loadBalancer: type: OpenShiftManagedDefault -featureSet: TechPreviewNoUpgrade pullSecret: ${PULL_SECRET} diff --git a/scripts/openstack/manifest-tests/lb-unmanaged/install-config.yaml b/scripts/openstack/manifest-tests/lb-unmanaged/install-config.yaml index 04402ddd67..f900dca597 100644 --- a/scripts/openstack/manifest-tests/lb-unmanaged/install-config.yaml +++ b/scripts/openstack/manifest-tests/lb-unmanaged/install-config.yaml @@ -30,5 +30,4 @@ platform: cloud: ${OS_CLOUD} loadBalancer: type: UserManaged -featureSet: TechPreviewNoUpgrade pullSecret: ${PULL_SECRET}