Skip to content

feat: adopt raidmgmt 0.15.0 with storcli2/perccli2 support#58

Merged
g-carre merged 3 commits into
mainfrom
improvement/ARTESCA-17775
Jul 3, 2026
Merged

feat: adopt raidmgmt 0.15.0 with storcli2/perccli2 support#58
g-carre merged 3 commits into
mainfrom
improvement/ARTESCA-17775

Conversation

@g-carre

@g-carre g-carre commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates disk-management-agent to the released raidmgmt and adopts the storcli2/perccli2 adapter, per ARTESCA-17775 (targets metalk8s 134 → ARTESCA 4.4.0).

  • Bump github.com/scality/raidmgmt v0.14.1 → v0.15.0 (go get + go mod tidy), which also picks up the controller-getter empty-inventory fix.
  • Wire the storcli2/perccli2 composition adapter (raidcontroller.NewStorCLI2) alongside the existing v1 storcli/perccli (megaraid.Adapter) and SmartArray paths, so MegaRAID 96xx / PERC 12 controllers are discovered on supported hardware.
  • New STORCLI2_PATH / PERCCLI2_PATH env vars default under the existing /host/libexec/MegaRAID mount, 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 nil on failure (the v2 runners, which don't validate at construction, are probed with exec.LookPath as ssacli is), that nil propagates through the controller/discoverer getters, and the use case skips absent/erroring discoverers. A v1-only or v2-only host already degrades gracefully.

Notes

  • The discoverer assembly is refactored onto a shared generic collectDiscoverers helper so the extra controller paths don't add five more copy-pasted nil-check blocks.
  • The raidmgmt command-runner constructor signature change flagged in the ticket (*string binary path) applies to the v2 runners; handled.

Testing

go build ./..., go vet ./..., make lint (0 issues), and make test (envtest, excluding the Kind-only test/e2e) all pass.

Issue: ARTESCA-17775

🤖 Generated with Claude Code

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>
@g-carre g-carre requested a review from a team as a code owner July 2, 2026 13:12
Comment thread pkg/infrastructure/di/usecase.go Outdated
Comment thread pkg/infrastructure/di/usecase.go
Comment thread pkg/infrastructure/di/usecase.go Outdated
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>
@g-carre g-carre requested a review from ezekiel-alexrod July 3, 2026 11:15
Comment thread pkg/infrastructure/di/usecase.go Outdated
Comment thread pkg/infrastructure/di/usecase.go Outdated
Comment thread pkg/infrastructure/di/usecase.go Outdated
Comment thread pkg/infrastructure/di/usecase.go Outdated
Co-authored-by: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com>
@g-carre g-carre merged commit d05e4b5 into main Jul 3, 2026
6 checks passed
@g-carre g-carre deleted the improvement/ARTESCA-17775 branch July 3, 2026 13:07
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.

2 participants