Skip to content

Commit

Permalink
Adjust logic on bmh controller
Browse files Browse the repository at this point in the history
- we no longer need the currentError stored, since we don't clear
  the ErrorType before calling Service.
- include dirty when changing the Status.Provisioning.Firmware, this
  is to ensure we would run an actionUpdate.

Signed-off-by: Iury Gregory Melo Ferreira <[email protected]>
  • Loading branch information
iurygregory committed Nov 5, 2024
1 parent 93c9382 commit f291a1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/metal3.io/baremetalhost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1402,14 +1402,13 @@ func (r *BareMetalHostReconciler) doServiceIfNeeded(prov provisioner.Provisioner
// succeed before leaving this state (e.g. by deprovisioning) we lose the signal that the
// update didn't actually happen. This is deemed an acceptable risk for the moment since it is only
// going to impact a small subset of Firmware Settings implementations.
currentError := info.host.Status.ErrorType
if info.host.Status.OperationalStatus != metal3api.OperationalStatusServicing {
info.host.Status.OperationalStatus = metal3api.OperationalStatusServicing
return actionUpdate{}
}

provResult, started, err := prov.Service(servicingData, dirty,
currentError == metal3api.ServicingError)
info.host.Status.ErrorType == metal3api.ServicingError)
if err != nil {
return actionError{fmt.Errorf("error servicing host: %w", err)}
}
Expand All @@ -1424,6 +1423,7 @@ func (r *BareMetalHostReconciler) doServiceIfNeeded(prov provisioner.Provisioner

if started && fwDirty {
info.host.Status.Provisioning.Firmware = info.host.Spec.Firmware.DeepCopy()
dirty = true
}

if provResult.Dirty {
Expand Down

0 comments on commit f291a1e

Please sign in to comment.