Skip to content

Commit a4ed73c

Browse files
Merge pull request #443 from jacobweinstock/updates
Wait for poweroff job properly on machine delete: ## Description <!--- Please describe what this PR is going to change --> poweroff job.bmc jobs were being deleted before they were completed successfully. This cause requeues so that the job.bmc job will complete successfully before moving on in DeleteMachineWithDependencies. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 06bf9fe + ea31cf5 commit a4ed73c

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) //nolint:goerr113
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)