1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00

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.
This commit is contained in:
Emilien Macchi
2023-04-24 15:34:11 -04:00
parent 85138dd3c4
commit 0321c41943
9 changed files with 1 additions and 123 deletions

View File

@@ -3610,7 +3610,7 @@ spec:
type: string type: string
loadBalancer: loadBalancer:
description: LoadBalancer defines how the load balancer used by description: LoadBalancer defines how the load balancer used by
the cluster is configured. LoadBalancer is available in TechPreview. the cluster is configured.
properties: properties:
type: type:
default: OpenShiftManagedDefault default: OpenShiftManagedDefault

View File

@@ -120,7 +120,6 @@ type Platform struct {
MachinesSubnet string `json:"machinesSubnet,omitempty"` MachinesSubnet string `json:"machinesSubnet,omitempty"`
// LoadBalancer defines how the load balancer used by the cluster is configured. // LoadBalancer defines how the load balancer used by the cluster is configured.
// LoadBalancer is available in TechPreview.
// +optional // +optional
LoadBalancer *configv1.OpenStackPlatformLoadBalancer `json:"loadBalancer,omitempty"` LoadBalancer *configv1.OpenStackPlatformLoadBalancer `json:"loadBalancer,omitempty"`
} }

View File

@@ -14,10 +14,6 @@ func FilledInTechPreviewFields(installConfig *types.InstallConfig) (fields []*fi
return nil 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 { 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")) fields = append(fields, field.NewPath("controlPlane", "platform", "openstack", "failureDomains"))
} }

View File

@@ -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)
}
})
}

View File

@@ -2028,20 +2028,6 @@ func TestValidateInstallConfig(t *testing.T) {
}(), }(),
expectedError: "platform.openstack.apiVIPs: Invalid value: \"foobar\": \"foobar\" is not a valid IP", 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)", name: "should not validate vips on VSphere if not set (vips are not required on VSphere)",
installConfig: func() *types.InstallConfig { installConfig: func() *types.InstallConfig {

View File

@@ -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}

View File

@@ -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)

View File

@@ -30,5 +30,4 @@ platform:
cloud: ${OS_CLOUD} cloud: ${OS_CLOUD}
loadBalancer: loadBalancer:
type: OpenShiftManagedDefault type: OpenShiftManagedDefault
featureSet: TechPreviewNoUpgrade
pullSecret: ${PULL_SECRET} pullSecret: ${PULL_SECRET}

View File

@@ -30,5 +30,4 @@ platform:
cloud: ${OS_CLOUD} cloud: ${OS_CLOUD}
loadBalancer: loadBalancer:
type: UserManaged type: UserManaged
featureSet: TechPreviewNoUpgrade
pullSecret: ${PULL_SECRET} pullSecret: ${PULL_SECRET}