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 4666104
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloud/scope/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ func (m *MachineScope) DeleteVPCLoadBalancerPoolMember() error {
return nil
}

if m.IBMVPCMachine.Status.InstanceID == "" {
m.Info("instance is not created, ignore deleting load balancer pool member")
return nil
}
instance, _, err := m.IBMVPCClient.GetInstance(&vpcv1.GetInstanceOptions{
ID: core.StringPtr(m.IBMVPCMachine.Status.InstanceID),
})
Expand Down

0 comments on commit 4666104

Please sign in to comment.