Skip to content

Commit

Permalink
PreprovisioningImage should not be created on poweroff
Browse files Browse the repository at this point in the history
PreprovisioningImage not created on poweroff

There is a new state StatePoweringOffBeforeDelete
that should not create the PreprovisioningImage.

This new state comes from a previous one called
StateDeleting that was contemplated about
not creating the PreprovisioningImage.

Just added the new state to nor create the image

Signed-off-by: Jose Gato <jgato@redhat.com>
  • Loading branch information
jgato committed Apr 29, 2024
1 parent 9af9c80 commit d2d700e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/metal3.io/baremetalhost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ func (r *BareMetalHostReconciler) registerHost(prov provisioner.Provisioner, inf
return actionError{err}
}
switch info.host.Status.Provisioning.State {
case metal3api.StateRegistering, metal3api.StateExternallyProvisioned, metal3api.StateDeleting:
case metal3api.StateRegistering, metal3api.StateExternallyProvisioned, metal3api.StateDeleting, metal3api.StatePoweringOffBeforeDelete:
// No need to create PreprovisioningImage if host is not yet registered
// or is externally provisioned
preprovImgFormats = nil
Expand Down

0 comments on commit d2d700e

Please sign in to comment.