Skip to content

Commit 3c69756

Browse files
Wait for poweroff job properly:
poweroff job.bmc jobs were being deleted before they completed successfully. This cause requeues so that the job.bmc job will complete successfully before moving on in DeleteMachineWithDependencies. Signed-off-by: Jacob Weinstock <[email protected]>
1 parent 06bf9fe commit 3c69756

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controller/machine/bmc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (scope *machineReconcileScope) createPowerOffJob(hw *tinkv1.Hardware) error
4848
"Name", bmcJob.Name,
4949
"Namespace", bmcJob.Namespace)
5050

51-
return nil
51+
return fmt.Errorf("requeue to wait for job.bmc completion: %s/%s", bmcJob.Namespace, bmcJob.Name)
5252
}
5353

5454
// getJob fetches the Job by name.
@@ -90,5 +90,5 @@ func (scope *machineReconcileScope) ensureBMCJobCompletionForDelete(hardware *ti
9090
return fmt.Errorf("bmc job %s/%s failed", bmcJob.Namespace, bmcJob.Name) //nolint:goerr113
9191
}
9292

93-
return nil
93+
return fmt.Errorf("requeue, bmc job %s/%s is not completed", bmcJob.Namespace, bmcJob.Name) //nolint:goerr113
9494
}

0 commit comments

Comments
 (0)