Skip to content

Commit

Permalink
Fix if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
vcatlassian committed Jun 15, 2023
1 parent dc722f2 commit 1f22c04
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/controller/cyclenoderequest/transitioner/transitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func (t *CycleNodeRequestTransitioner) transitionHealing() (reconcile.Result, er
if err != nil {
return t.transitionToFailed(err)
}

if !nodeExists {
t.rm.LogEvent(t.cycleNodeRequest,
"HealingNodes", "Node does not exist, skip healing node: %s", node.Name)
Expand All @@ -533,13 +533,12 @@ func (t *CycleNodeRequestTransitioner) transitionHealing() (reconcile.Result, er

// try and re-attach the nodes, if any were un-attached
t.rm.LogEvent(t.cycleNodeRequest, "AttachingNodes", "Attaching instances to nodes group: %v", node.Name)
alreadyAttached, err := nodeGroups.AttachInstance(node.ProviderID, node.NodeGroupName)
if alreadyAttached {
// if the node is already attached, ignore the error and continue to un-cordoning, otherwise return with error
if alreadyAttached, err := nodeGroups.AttachInstance(node.ProviderID, node.NodeGroupName); alreadyAttached {
t.rm.LogEvent(t.cycleNodeRequest,
"AttachingNodes", "Skip re-attaching instances to nodes group: %v, err: %v",
node.Name, err)
}
if err != nil {
} else if err != nil {
return t.transitionToFailed(err)
}

Expand Down

0 comments on commit 1f22c04

Please sign in to comment.