Skip to content

io shaping: detect missing subcommand and surface friendly message#26

Merged
lobis merged 2 commits intomainfrom
io-shaping-unsupported-message
Apr 27, 2026
Merged

io shaping: detect missing subcommand and surface friendly message#26
lobis merged 2 commits intomainfrom
io-shaping-unsupported-message

Conversation

@lobis
Copy link
Copy Markdown
Collaborator

@lobis lobis commented Apr 27, 2026

Summary

On EOS instances that ship without the io shaping subcommand (observed on eosaliceo2-ns-02), eos io shaping ls exits 22 and dumps the generic io stat / io enable usage block on stdout. We were wrapping that error and rendering the entire usage text in the IO Traffic view, burying the actual cause.

  • New ErrIOShapingUnsupported sentinel in eos/fetch_ioshaping.go.
  • looksUnsupported recognises the pattern: exit status 22 + a usage block that does not mention shaping. Applied to both IOShaping() and IOShapingPolicies() call sites.
  • View checks errors.Is(err, eos.ErrIOShapingUnsupported) and shows a two-line message pointing the user at eos io --help instead of the raw output.

Tests

  • TestLooksUnsupported covers the real eosaliceo2 output, plus negative cases (nil error, exit 1 with the same body, exit 22 with shaping mentioned, exit 22 with unrelated text).

Test plan

  • gofmt -l . clean, go build ./..., go test ./... pass
  • make deploy-both
  • Manually verify on eosaliceo2-ns-02: IO Traffic view shows the friendly message instead of the help dump
  • Verify on a cluster that does support io shaping: view loads normally

lobis and others added 2 commits April 27, 2026 11:42
On EOS instances that ship without the io shaping subcommand
(e.g. eosaliceo2-ns-02), `eos io shaping ls` exits 22 and dumps the
generic `io stat` / `io enable` usage block on stdout. We were
wrapping that as an error and rendering it verbatim in the IO Traffic
view, which buried the actual cause under a wall of unrelated help
text.

Detect the pattern (exit status 22 + usage block that omits any mention
of shaping) and return a sentinel ErrIOShapingUnsupported. The view
checks for it via errors.Is and renders a short, actionable message
instead of the raw output.
@lobis lobis merged commit 5038a43 into main Apr 27, 2026
4 checks passed
@lobis lobis deleted the io-shaping-unsupported-message branch April 27, 2026 09:45
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