DockerCLI/cli/command/image
Sebastiaan van Stijn 839dbbcf27
cli/command/images: set cmd.Args to prevent test-failures
When running tests from my IDE, it compiles the tests before running,
then executes the compiled binary to run the tests. Cobra doesn't like that,
because in that situation os.Args is taken as argument for the command that's
executed. The command that's tested now sees the `test-` flags as arguments
(`-test.v -test.run ..`), which causes various tests to fail ("Command XYZ
does not accept arguments").

    # compile the tests:
    go test -c -o foo.test

    # execute the test:
    ./foo.test -test.v -test.run TestFoo
    === RUN   TestFoo
    Error: "foo" accepts no arguments.

Set arguments to an empty slice to make sure it doesn't inherit arguments
from the test-binary.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-10-08 20:26:15 +02:00
..
build cli/command/image/build: fix nosec comment 2024-06-10 21:19:32 +02:00
testdata vendor: github.com/docker/docker 70e46f2c7c2d (v26.0.0-rc3-dev) 2024-03-16 16:53:20 +01:00
build.go cli/command/image: add shell completion for --platform flags 2024-10-08 13:15:28 +02:00
build_test.go test spring-cleaning 2024-07-04 01:35:12 +02:00
client_test.go vendor: github.com/docker/docker 164cae56ed95 (master, v-next) 2024-09-24 16:30:30 +02:00
cmd.go Adopt Cobra completion v2 to support completion by CLI plugins 2022-05-12 12:59:10 +02:00
formatter_history.go linting: address else/if/elseif statements found by gocritic 2023-11-20 16:02:16 +01:00
formatter_history_test.go golangci-lint: enable dupword linter 2023-11-20 16:02:18 +01:00
history.go vendor: github.com/docker/docker 164cae56ed95 (master, v-next) 2024-09-24 16:30:30 +02:00
history_test.go vendor: github.com/docker/docker 164cae56ed95 (master, v-next) 2024-09-24 16:30:30 +02:00
import.go cli/command/image: add shell completion for --platform flags 2024-10-08 13:15:28 +02:00
import_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
inspect.go Enable completion for 'image' sub commands 2024-07-03 17:00:40 +01:00
inspect_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
list.go image/list: Add `--tree` flag 2024-08-16 15:09:51 +02:00
list_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
load.go vendor: github.com/docker/docker 164cae56ed95 (master, v-next) 2024-09-24 16:30:30 +02:00
load_test.go cli/command/images: set cmd.Args to prevent test-failures 2024-10-08 20:26:15 +02:00
prune.go chore: remove backticks and resolve linting issues 2024-04-02 15:54:29 +02:00
prune_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
pull.go cli/command/image: add shell completion for --platform flags 2024-10-08 13:15:28 +02:00
pull_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
push.go cli/command/image: add shell completion for --platform flags 2024-10-08 13:15:28 +02:00
push_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
remove.go Enable completion for 'image' sub commands 2024-07-03 17:00:40 +01:00
remove_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
save.go vendor: github.com/docker/docker 164cae56ed95 (master, v-next) 2024-09-24 16:30:30 +02:00
save_test.go cli/command/image: fix TestNewSaveCommandSuccess to actually test 2024-10-08 19:41:05 +02:00
tag.go Plumb contexts through commands 2023-12-12 22:30:16 +01:00
tag_test.go cli: improve argument validation output 2024-07-05 03:35:14 +02:00
tree.go Merge pull request #5474 from docker/change_to_inuse 2024-09-24 10:37:17 +02:00
trust.go Removed all mentions of "please" from docs and messages 2024-06-11 16:53:40 +02:00
trust_test.go replace uses of deprecated env.Patch() 2022-09-22 17:28:07 +02:00