Skip to content

Commit

Permalink
skip load balancer pool member deletion if instance creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Amulyam24 committed May 20, 2024
1 parent 83e571f commit cbb3fa7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cloud/scope/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ func (m *MachineScope) CreateVPCLoadBalancerPoolMember(internalIP *string, targe

// DeleteVPCLoadBalancerPoolMember deletes a pool member from the load balancer pool.
func (m *MachineScope) DeleteVPCLoadBalancerPoolMember() error {
if m.IBMVPCMachine.Status.InstanceID == "" {
m.Info("instance is not created, ignore deleting load balancer pool member")
return nil
}

loadBalancer, _, err := m.IBMVPCClient.GetLoadBalancer(&vpcv1.GetLoadBalancerOptions{
ID: m.IBMVPCCluster.Status.VPCEndpoint.LBID,
})
Expand Down

0 comments on commit cbb3fa7

Please sign in to comment.