Skip to content

Introduce ErrNotSupported sentinel error for unimplemented vendor BMC methods #735

@coderabbitai

Description

@coderabbitai

Summary

Controllers such as internal/controller/bmcversion_controller.go and internal/controller/biosversion_controller.go call vendor-specific BMC client methods (e.g. CheckBMCPendingComponentUpgrade) and currently treat all errors identically — including the base RedfishBaseBMC fallback that returns a "not supported by this manufacturer" error. This means transient Redfish/FirmwareInventory failures are silently swallowed and the upgrade proceeds, which is the same behavior as a legitimate "not supported" response.

Motivation

Introducing a dedicated ErrNotSupported sentinel error would allow controllers to:

  • Ignore the "not supported by vendor" case (current behavior, intentional)
  • Requeue on transient or real check failures instead of blindly proceeding with the upgrade

This improves safety: a temporary FirmwareInventory unavailability would no longer silently bypass the pending-upgrade guard.

Scope

  • Define an ErrNotSupported sentinel (e.g. in bmc/bmc.go or a shared errors file)
  • Update RedfishBaseBMC.CheckBMCPendingComponentUpgrade (and similar fallback methods) in bmc/redfish.go to wrap/return ErrNotSupported
  • Update affected controllers (bmcversion_controller.go, biosversion_controller.go, and any future controllers) to use errors.Is(err, bmc.ErrNotSupported) to distinguish the two cases
  • Consider applying the same pattern to other vendor-specific BMC interface methods that currently have a "not supported" fallback

References

/cc @davidgrun

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions