Explore/upgrade gofish#131
Open
alexlovelltroy wants to merge 2 commits into
Open
Conversation
- 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>
…BMC layer Signed-off-by: Alex Lovell-Troy <alex@lovelltroy.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the power control command and the BMC (Baseboard Management Controller) client, focusing on vendor-neutral operations, context handling, and dependency updates. The changes modernize the codebase to use the latest libraries, add robust context support for cancellation and deadlines, and enhance test coverage for flag handling and BMC operations.
Key highlights:
--operationflag to thepowercommand, with graceful fallback logic.context.Context, enabling cancellation and deadline propagation.gofish,cobra, andviper, to their latest versions.Power command enhancements
--operation(-o) flag to thepowercommand, allowing users to specify high-level power operations (e.g., on, off, soft-restart), which are resolved to supported Redfish reset types with fallback logic. Also, improves flag validation and help text. (cmd/power.go[1] [2] [3]-lshorthand for--list-reset-typesto avoid collision with the global--log-levelflag, and updates usage examples accordingly. (cmd/power.gocmd/power.goL239-R270)BMC client context support and API improvements
context.Contextparameter, ensuring that cancellations and timeouts are respected for all BMC operations. (pkg/bmc/client.go[1] [2] [3] [4] [5]ResetOperationmethod that maps vendor-neutral operations to supported Redfish reset types, applying fallback logic, and returns the task monitor for async operations. (pkg/bmc/client.go[1] [2]Dependency and compatibility updates
gofish(v0.22.0),cobra,viper, and others, ensuring compatibility and access to new features (notably,gofishnow returns task monitor info for resets). (go.modgo.modL3-L64)Improved testing and validation
powercommand executes without flag collisions, guarding against regressions with CLI shorthand flags. (cmd/power_test.gocmd/power_test.goR1-R30)pkg/bmc/client_test.go[1] [2] [3]Code and documentation cleanup
schemasinstead of the deprecatedredfishpackage, and clarifies context handling semantics. (cmd/power.go[1]pkg/bmc/client.go[2] [3] [4]pkg/bmc/manager.go[5]These changes collectively improve the flexibility, reliability, and maintainability of the power management subsystem.
For more info, see Contributing Guidelines.