mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 06:46:36 +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:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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"))
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
@@ -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}
|
||||
@@ -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)
|
||||
@@ -30,5 +30,4 @@ platform:
|
||||
cloud: ${OS_CLOUD}
|
||||
loadBalancer:
|
||||
type: OpenShiftManagedDefault
|
||||
featureSet: TechPreviewNoUpgrade
|
||||
pullSecret: ${PULL_SECRET}
|
||||
|
||||
@@ -30,5 +30,4 @@ platform:
|
||||
cloud: ${OS_CLOUD}
|
||||
loadBalancer:
|
||||
type: UserManaged
|
||||
featureSet: TechPreviewNoUpgrade
|
||||
pullSecret: ${PULL_SECRET}
|
||||
|
||||
Reference in New Issue
Block a user