DockerCLI/cli/command/context
Sebastiaan van Stijn 6ba7de3b5a
cli/command/context: "docker context show": don't validate context
The "docker context show" command is intended to show the currently configured
context. While the context that's configured may not be valid (e.g., in case
an environment variable was set to configure the context, or if the context
was removed from the filesystem), we should still be able to _show_ the
context.

This patch removes the context validation, and instead only shows the context.
This can help in cases where the context is used to (e.g.) set the command-
prompt, but the user removed the context. With this change, the context name
can still be shown, but commands that _require_ the context will still fail.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-28 11:30:35 +01:00
..
testdata introduce `context show` command 2022-04-25 14:40:24 +02:00
cmd.go introduce `context show` command 2022-04-25 14:40:24 +02:00
create.go cli/context/store: simplify error handling, and make it more idiomatic 2022-09-30 11:19:25 +02:00
create_test.go cli/command/context: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:50 +01:00
export-import_test.go format go with gofumpt (with -lang=1.19) 2022-09-30 19:14:36 +02:00
export.go format go with gofumpt (with -lang=1.19) 2022-09-30 19:14:36 +02:00
import.go Introduce .zip import for docker context 2019-05-29 12:58:45 -07:00
inspect.go introduce `context show` command 2022-04-25 14:40:24 +02:00
inspect_test.go cli/command/context: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:50 +01:00
list.go cli/command/context: minor cleanup in runList() 2022-11-22 12:57:57 +01:00
list_test.go cli/command/context: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:50 +01:00
options.go Drop support for (archived) Compose-on-Kubernetes 2022-02-22 13:47:34 +01:00
remove.go cli/context/store: simplify error handling, and make it more idiomatic 2022-09-30 11:19:25 +02:00
remove_test.go cli/context/store: simplify error handling, and make it more idiomatic 2022-09-30 11:19:25 +02:00
show.go cli/command/context: "docker context show": don't validate context 2022-11-28 11:30:35 +01:00
show_test.go cli/command/context: "docker context show": don't validate context 2022-11-28 11:30:35 +01:00
update.go use our own version of text/tabwriter 2022-04-25 15:01:41 +02:00
update_test.go cli/command/context: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:50 +01:00
use.go context use: don't create/update config file and directories if not needed 2022-07-29 14:20:05 +02:00
use_test.go cli/context/store: simplify error handling, and make it more idiomatic 2022-09-30 11:19:25 +02:00