Skip to content

Commit

Permalink
Merge pull request #2227 from iurygregory/hfc-redfish-only-upstream
Browse files Browse the repository at this point in the history
🐛  Do not create HFC for non-redfish BMH
  • Loading branch information
metal3-io-bot authored Jan 30, 2025
2 parents f397543 + b44e141 commit cfa3903
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions controllers/metal3.io/baremetalhost_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,13 @@ func (r *BareMetalHostReconciler) registerHost(prov provisioner.Provisioner, inf
return actionUpdate{}
}

// Check if the host can support firmware components before creating the resrouce
_, errGetFirmwareComponents := prov.GetFirmwareComponents()
supportsFirmwareComponents := true
if errGetFirmwareComponents != nil && errors.Is(errGetFirmwareComponents, provisioner.ErrFirmwareUpdateUnsupported) {
supportsFirmwareComponents = false
}

// Create the hostFirmwareSettings resource with same host name/namespace if it doesn't exist
// Create the hostFirmwareComponents resource with same host name/namespace if it doesn't exist
if info.host.Name != "" {
Expand All @@ -901,9 +908,11 @@ func (r *BareMetalHostReconciler) registerHost(prov provisioner.Provisioner, inf
info.log.Info("failed creating hostfirmwaresettings")
return actionError{errors.Wrap(err, "failed creating hostFirmwareSettings")}
}
if err = r.createHostFirmwareComponents(info); err != nil {
info.log.Info("failed creating hostfirmwarecomponents")
return actionError{errors.Wrap(err, "failed creating hostFirmwareComponents")}
if supportsFirmwareComponents {
if err = r.createHostFirmwareComponents(info); err != nil {
info.log.Info("failed creating hostfirmwarecomponents")
return actionError{errors.Wrap(err, "failed creating hostFirmwareComponents")}
}
}
if _, err = r.acquireHostUpdatePolicy(info); err != nil {
info.log.Info("failed setting owner reference on hostupdatepolicy")
Expand Down

0 comments on commit cfa3903

Please sign in to comment.