Skip to content

Feature/rfd 133 explore#133

Draft
alexlovelltroy wants to merge 3 commits into
mainfrom
feature/RFD-133-Explore
Draft

Feature/rfd 133 explore#133
alexlovelltroy wants to merge 3 commits into
mainfrom
feature/RFD-133-Explore

Conversation

@alexlovelltroy

Copy link
Copy Markdown
Member

This pull request introduces a new vendor-agnostic BMC (Baseboard Management Controller) client abstraction layer, enabling vendor-specific handling and plugin registration for BMC operations. It provides a unified interface for BMC interactions, a registry for vendor plugin detection and dispatch, and a manager for connection/session management. Comprehensive tests are included for all new components. The most important changes are as follows:

BMC Client Abstraction and Vendor Plugin System:

  • Introduced a new Client interface in pkg/bmc/client.go that abstracts BMC operations and shields callers from vendor-specific details. Added a default GenericClient implementation and a mechanism for vendor plugins to override behavior. Also defined the Vendor type and error handling for unsupported operations.
  • Added a plugin registry system in pkg/bmc/registry.go to allow vendor plugins to register detectors and factories. The clientFor function wraps a gofish client with the most specific registered vendor client or falls back to the generic client.
  • Registered the in-tree BMC vendor plugins in cmd/root.go by blank-importing pkg/bmc/vendors so their init() functions run and register themselves.
  • Added a Cray-specific vendor plugin in pkg/bmc/vendors/cray/cray.go that detects Cray BMCs and provides a placeholder for Cray-specific quirks.

Connection and Session Management:

  • Implemented a ConnConfig struct in pkg/bmc/conn.go for canonical BMC connection configuration, including credential resolution logic.
  • Added a Manager in pkg/bmc/manager.go as the single authority for opening and caching BMC sessions, performing vendor detection, and managing session lifecycles.

Testing and Validation:

  • Added comprehensive unit tests for the new client abstraction (pkg/bmc/client_test.go), connection configuration (pkg/bmc/conn_test.go), manager/session logic (pkg/bmc/manager_test.go), and plugin registry (pkg/bmc/registry_test.go). [1] [2] [3] [4]

For more info, see Contributing Guidelines.

Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
@alexlovelltroy alexlovelltroy marked this pull request as draft June 12, 2026 14:56
* Refactor to upgrade to gofish 0.22.0 with new schemas package

- Updated imports from redfish to schemas in various files to align with the new package structure.
- Modified Client interface methods to return types from schemas instead of redfish.
- Adjusted implementations in GenericClient to accommodate the new schemas types.
- Updated tests to reflect changes in the types used for power states and reset types.
- Refactored functions in collect, crawler, power, service, and update packages to utilize schemas types.
- Introduced helper functions to dereference optional numeric fields for better handling of nil values.

Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>

* feat: implement context-aware power operations and reset handling in BMC layer

Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>

* feat: enhance power command to support flexible node identifiers and improve inventory handling

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>

---------

Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant