Skip to content

Commit

Permalink
Skip powering off for some states
Browse files Browse the repository at this point in the history
Namely registering, unmanaged, and none.  This is to prevent a stuck
case where incorrect credentials have been provided.
  • Loading branch information
honza committed Sep 14, 2023
1 parent 204b21f commit 8cf8e29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/metal3.io/host_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ func (hsm *hostStateMachine) checkInitiateDelete(log logr.Logger) bool {
switch hsm.NextState {
default:
hsm.NextState = metal3api.StatePoweringOffBeforeDelete
case metal3api.StateRegistering, metal3api.StateUnmanaged, metal3api.StateNone:
// Skip the power off before delete
hsm.NextState = metal3api.StateDeleting
case metal3api.StateProvisioning, metal3api.StateProvisioned:
if hsm.Host.OperationalStatus() == metal3api.OperationalStatusDetached {
if delayDeleteForDetachedHost(hsm.Host) {
Expand Down

0 comments on commit 8cf8e29

Please sign in to comment.