Skip to content

Commit

Permalink
OCPBUGS-43692: Fix LB Type Defaulting with ProviderParameters Set
Browse files Browse the repository at this point in the history
In the case that `alreadyAdmitted` was true and the IngressController's
spec had `providerParameters` set, `setDefaultProviderParameters`
incorrectly forced the LB type to `Classic`.

This fix relocates the `alreadyAdmitted` check to the logic responsible
for mutating the LB type, rather than applying it to the logic that
determines the `defaultLBType` value.
  • Loading branch information
gcs278 committed Oct 22, 2024
1 parent 8bf1b36 commit 304b7b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/operator/controller/ingress/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,15 +701,15 @@ func setDefaultProviderParameters(lbs *operatorv1.LoadBalancerStrategy, ingressC
}
lbs.ProviderParameters.Type = provider
defaultLBType := operatorv1.AWSClassicLoadBalancer
if p := ingressConfig.Spec.LoadBalancer.Platform; !alreadyAdmitted && p.Type == configv1.AWSPlatformType && p.AWS != nil {
if p := ingressConfig.Spec.LoadBalancer.Platform; p.Type == configv1.AWSPlatformType && p.AWS != nil {
if p.AWS.Type == configv1.NLB {
defaultLBType = operatorv1.AWSNetworkLoadBalancer
}
}
if lbs.ProviderParameters.AWS == nil {
lbs.ProviderParameters.AWS = &operatorv1.AWSLoadBalancerParameters{}
}
if len(lbs.ProviderParameters.AWS.Type) == 0 {
if len(lbs.ProviderParameters.AWS.Type) == 0 && !alreadyAdmitted {
lbs.ProviderParameters.AWS.Type = defaultLBType
}
switch lbs.ProviderParameters.AWS.Type {
Expand Down

0 comments on commit 304b7b6

Please sign in to comment.