Skip to content

fix(bridge): validate arguments of bridge subcommands - #14003

Open
glours wants to merge 1 commit into
docker:mainfrom
glours:fix-bridge-commands-args
Open

fix(bridge): validate arguments of bridge subcommands#14003
glours wants to merge 1 commit into
docker:mainfrom
glours:fix-bridge-commands-args

Conversation

@glours

@glours glours commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What I did
docker compose bridge transformations create panicked with an index out of range when invoked without its PATH argument, as RunE indexed args[0] without any validator. Add cli.ExactArgs(1) so the CLI reports a proper usage error instead.

Also add cobra.NoArgs to bridge convert and bridge transformations list, which silently ignored stray arguments.

Related issue
https://docker.atlassian.net/browse/DDB-612

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

`docker compose bridge transformations create` panicked with an index
out of range when invoked without its PATH argument, as RunE indexed
args[0] without any validator. Add cli.ExactArgs(1) so the CLI reports
a proper usage error instead.

Also add cobra.NoArgs to `bridge convert` and `bridge transformations
list`, which silently ignored stray arguments.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours
glours requested review from a team as code owners August 5, 2026 10:16
@glours
glours requested a review from ndeloof August 5, 2026 10:16
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@maxproske

Copy link
Copy Markdown
Contributor

That was fast! :)

./bin/docker-compose bridge transformations create
# docker: 'docker compose bridge transformations create' requires 1 argument
# Usage:  docker compose bridge transformations create [OPTION] PATH

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