Skip to content

Commit

Permalink
Merge pull request #2060 from iurygregory/hfc-error-logic
Browse files Browse the repository at this point in the history
🐛 Update HFC Status when handling error in actionPreparing
  • Loading branch information
metal3-io-bot authored Nov 25, 2024
2 parents 4701088 + a7dd63e commit be0db3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controllers/metal3.io/baremetalhost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,9 +1178,12 @@ func (r *BareMetalHostReconciler) actionPreparing(prov provisioner.Provisioner,
info.log.Info("handling cleaning error in controller")
clearHostProvisioningSettings(info.host)
}
if hfcDirty {
if hfcDirty && hfc.Status.Updates != nil {
info.log.Info("handling cleaning error during firmware update")
hfc.Status.Updates = nil
if err := r.Status().Update(info.ctx, hfc); err != nil {
return actionError{errors.Wrap(err, "failed to update hostfirmwarecomponents status")}
}
}
return recordActionFailure(info, metal3api.PreparationError, provResult.ErrorMessage)
}
Expand Down

0 comments on commit be0db3b

Please sign in to comment.