Skip to content

Commit 1bd219a

Browse files
pranavsriram8YashwantGohokar
authored andcommitted
process updateLoadbalancer if NLB is in failed state
1 parent 8f73200 commit 1bd219a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pkg/cloudprovider/providers/oci/load_balancer.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,20 @@ func (cp *CloudProvider) EnsureLoadBalancer(ctx context.Context, clusterName str
756756
}
757757

758758
if lb.LifecycleState == nil || *lb.LifecycleState != lbLifecycleStateActive {
759-
logger.With("lifecycleState", lb.LifecycleState).Infof("LB is not in %s state, will retry EnsureLoadBalancer", lbLifecycleStateActive)
760-
return nil, errors.Errorf("rejecting request to update LB which is not in %s state", lbLifecycleStateActive)
759+
logger := logger.With("lifecycleState", lb.LifecycleState)
760+
switch loadBalancerType {
761+
case NLB:
762+
// This check is added here since NLBs are marked as failed in case nlb work-requests fail NLB-26239
763+
if *lb.LifecycleState == string(networkloadbalancer.LifecycleStateFailed) {
764+
logger.Infof("NLB is in %s state, process the Loadbalancer", *lb.LifecycleState)
765+
} else {
766+
return nil, errors.Errorf("NLB is in %s state, wait for NLB to move to %s", *lb.LifecycleState, lbLifecycleStateActive)
767+
}
768+
break
769+
default:
770+
logger.Infof("LB is not in %s state, will retry EnsureLoadBalancer", lbLifecycleStateActive)
771+
return nil, errors.Errorf("rejecting request to update LB which is not in %s state", lbLifecycleStateActive)
772+
}
761773
}
762774

763775
// Existing load balancers cannot change subnets. This ensures that the spec matches

0 commit comments

Comments
 (0)