feat: adopt raidmgmt 0.15.0 with storcli2/perccli2 support#58
Merged
Conversation
Bump github.com/scality/raidmgmt v0.14.1 => v0.15.0 and wire the storcli2/perccli2 composition adapter (raidcontroller.NewStorCLI2) alongside the existing v1 storcli/perccli (megaraid.Adapter) and SmartArray controller paths, so MegaRAID 96xx / PERC 12 controllers are discovered on supported hardware. The bump also picks up the controller-getter empty-inventory fix. The v2 command runners (commandrunner.NewStorCLI2/NewPercCLI2) take a *string binary path and, unlike NewMegaRAIDRunner, do not validate the binary at construction; availability is probed with exec.LookPath (as for ssacli) so a missing binary warns and disables the discoverer. No os.Exit workaround is needed here (unlike the report generator's platform-raid-report-generator#46): this agent already builds every runner lazily and skips absent ones by returning nil, so a v1-only or v2-only host degrades gracefully on its own. New STORCLI2_PATH / PERCCLI2_PATH env vars default under the existing /host/libexec/MegaRAID mount, so no new volume is required. The discoverer assembly is refactored onto a shared generic collectDiscoverers helper to absorb the extra controller paths without five more copy-pasted nil-check blocks. Issue: ARTESCA-17775 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review, revert buildPhysicalDriveDiscoverers/buildLogicalVolumeDiscoverers to the original explicit if-block form so the storcli2/perccli2 change is just two added blocks per function, which reads more clearly than the generic collectDiscoverers/present helpers. The mirror pair keeps the //nolint:dupl annotation already used elsewhere in this package. Issue: ARTESCA-17775 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com>
ezekiel-alexrod
approved these changes
Jul 3, 2026
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.
Summary
Updates
disk-management-agentto the releasedraidmgmtand adopts the storcli2/perccli2 adapter, per ARTESCA-17775 (targets metalk8s 134 → ARTESCA 4.4.0).github.com/scality/raidmgmtv0.14.1 → v0.15.0 (go get+go mod tidy), which also picks up the controller-getter empty-inventory fix.raidcontroller.NewStorCLI2) alongside the existing v1 storcli/perccli (megaraid.Adapter) and SmartArray paths, so MegaRAID 96xx / PERC 12 controllers are discovered on supported hardware.STORCLI2_PATH/PERCCLI2_PATHenv vars default under the existing/host/libexec/MegaRAIDmount, so no new volume is required.The v1 workaround (platform-raid-report-generator#46) — not needed here
That PR removed an
os.Exit(1)fired at DI-construction time when the v1 megaraid binaries were absent, which also blocked the lazy v2 gatherers on a storcli2-only host.This agent never had that bug: every runner is built lazily and returns
nilon failure (the v2 runners, which don't validate at construction, are probed withexec.LookPathasssacliis), thatnilpropagates through the controller/discoverer getters, and the use case skips absent/erroring discoverers. A v1-only or v2-only host already degrades gracefully.Notes
collectDiscoverershelper so the extra controller paths don't add five more copy-pasted nil-check blocks.raidmgmtcommand-runner constructor signature change flagged in the ticket (*stringbinary path) applies to the v2 runners; handled.Testing
go build ./...,go vet ./...,make lint(0 issues), andmake test(envtest, excluding the Kind-onlytest/e2e) all pass.Issue: ARTESCA-17775
🤖 Generated with Claude Code