77
88 "github.com/asaskevich/govalidator"
99 configv1 "github.com/openshift/api/config/v1"
10- operatorv1 "github.com/openshift/api/operator/v1"
1110 ini "gopkg.in/ini.v1"
1211 appsv1 "k8s.io/api/apps/v1"
1312 "k8s.io/klog/v2"
@@ -62,17 +61,11 @@ func getTemplateValues(images *imagesReference, operatorConfig config.OperatorCo
6261
6362// createLoadBalancerSection creates a loadBalancer section populated with
6463// OpenShift defaults. It returns any error that happens.
65- func createLoadBalancerSection (cfg * ini.File , network * configv1. Network ) error {
64+ func createLoadBalancerSection (cfg * ini.File ) error {
6665 loadBalancer , err := cfg .NewSection ("LoadBalancer" )
6766 if err != nil {
6867 return fmt .Errorf ("failed to modify the provided configuration: %w" , err )
6968 }
70- if network .Spec .NetworkType == string (operatorv1 .NetworkTypeKuryr ) {
71- _ , err = loadBalancer .NewKey ("enabled" , "false" )
72- if err != nil {
73- return fmt .Errorf ("failed to modify the provided configuration: %w" , err )
74- }
75- }
7669 // Disable shared services by default as a feature that's potentially dangerous if misued.
7770 _ , err = loadBalancer .NewKey ("max-shared-lb" , "1" )
7871 if err != nil {
@@ -89,21 +82,9 @@ func createLoadBalancerSection(cfg *ini.File, network *configv1.Network) error {
8982
9083// updateLoadBalancerSection updates the loadBalancer section with OpenShift
9184// defaults. It returns any error that happens.
92- func updateLoadBalancerSection (loadBalancer * ini.Section , network * configv1. Network ) error {
85+ func updateLoadBalancerSection (loadBalancer * ini.Section ) error {
9386 loadBalancer .DeleteKey ("use-octavia" ) // use-octavia is no longer used, let's make sure it's gone from config
9487
95- if network .Spec .NetworkType == string (operatorv1 .NetworkTypeKuryr ) {
96- enabledKey , err := loadBalancer .GetKey ("enabled" )
97- if err != nil {
98- _ , err = loadBalancer .NewKey ("enabled" , "false" )
99- if err != nil {
100- return fmt .Errorf ("failed to modify the provided configuration: %w" , err )
101- }
102- } else {
103- enabledKey .SetValue ("false" )
104- }
105- }
106-
10788 // Disable shared LBs by default if not overriden already
10889 _ , err := loadBalancer .GetKey ("max-shared-lb" )
10990 if err != nil {
@@ -214,11 +195,11 @@ func CloudConfigTransformer(source string, infra *configv1.Infrastructure, netwo
214195
215196 loadBalancer , _ := cfg .GetSection ("LoadBalancer" )
216197 if loadBalancer == nil {
217- if err = createLoadBalancerSection (cfg , network ); err != nil {
198+ if err = createLoadBalancerSection (cfg ); err != nil {
218199 return "" , fmt .Errorf ("could not create load balancer section: %w" , err )
219200 }
220201 } else {
221- if err = updateLoadBalancerSection (loadBalancer , network ); err != nil {
202+ if err = updateLoadBalancerSection (loadBalancer ); err != nil {
222203 return "" , fmt .Errorf ("could not update load balancer section: %w" , err )
223204 }
224205 }
0 commit comments