Skip to content

fix: avoid panics on invalid inspect request arguments#1965

Open
immanuwell wants to merge 1 commit into
dragonflyoss:masterfrom
immanuwell:fix/inspect-request-args
Open

fix: avoid panics on invalid inspect request arguments#1965
immanuwell wants to merge 1 commit into
dragonflyoss:masterfrom
immanuwell:fix/inspect-request-args

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

Overview

nydus-image inspect --request can still panic on bad args. Easy to hit with a typo, pretty meh.

Related Issues

Related #705

Change Details

Parse chunk OFFSET like icheck INODE, return normal errors in request mode, and add regression tests. Tiny fix, keeps valid requests working the same.

Test Results

cargo test -q --bin nydus-image

Repro before:
cargo run -q --bin nydus-image -- inspect tests/texture/bootstrap/rafs-v5.boot --request 'chunk abc'
cargo run -q --bin nydus-image -- inspect tests/texture/bootstrap/rafs-v5.boot --request 'icheck abc'

Before: panic
Now: Error: invalid arguments in inspect request 'chunk abc'
Now: Error: invalid arguments in inspect request 'icheck abc'

Valid request check:
cargo run -q --bin nydus-image -- inspect tests/texture/bootstrap/rafs-v5.boot --request 'stats'

Change Type

  • Bug Fix
  • Feature Addition
  • Documentation Update
  • Code Refactoring
  • Performance Improvement
  • Other (please describe)

Self-Checklist

  • I have run a code style check and addressed any warnings/errors.
  • I have added appropriate comments to my code (if applicable).
  • I have updated the documentation (if applicable).
  • I have written appropriate unit tests.

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell immanuwell force-pushed the fix/inspect-request-args branch from 00efe73 to da832de Compare June 16, 2026 14:31
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