DockerCLI/cli
Sebastiaan van Stijn 3b7235edca
cli/command: initialize client and load content lazily
This allows commands that don't require a client connection (such as `context use`)
to be functional, but still produces an error when trying to run a command that
needs to connect with the API;

    mkdir -p ~/.docker/ && echo '{"currentContext":"nosuchcontext"}' >  ~/.docker/config.json
    docker version
    Failed to initialize: unable to resolve docker endpoint: load context "nosuchcontext": context does not exist: open /root/.docker/contexts/meta/8bfef2a74c7d06add4bf4c73b0af97d9f79c76fe151ae0e18b9d7e57104c149b/meta.json: no such file or directory

    docker context use default
    default
    Current context is now "default"

    docker version
    Client:
     Version:           22.06.0-dev
     API version:       1.42
     ...

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-11-28 16:52:02 +01:00
..
command cli/command: initialize client and load content lazily 2022-11-28 16:52:02 +01:00
compose cli/compose/loader: fix error messages, and various tests 2022-11-17 13:17:51 +01:00
config format go with gofumpt (with -lang=1.19) 2022-09-30 19:14:36 +02:00
connhelper format code with gofumpt 2022-09-30 11:59:11 +02:00
context cli/context/store: make sure we handle wrapped errors 2022-11-22 12:20:32 +01:00
debug updated vendoring 2017-09-01 19:41:06 -04:00
flags cli/flags: merge CommonOptions into ClientOptions 2022-11-22 12:32:18 +01:00
manifest format go with gofumpt (with -lang=1.19) 2022-09-30 19:14:36 +02:00
registry/client cli/registry/client: remove unused IsNotFound(), and slight refactor 2022-03-30 20:00:36 +02:00
streams update docker, replace github.com/docker/pkg/term, github.com/docker/pkg/mount 2020-04-22 17:16:13 +02:00
trust format code with gofumpt 2022-09-30 11:59:11 +02:00
version Move versioning variables to a separate package. 2019-01-29 11:26:40 +00:00
winresources Use goversioninfo to create Windows Version Info 2021-10-11 16:54:22 +02:00
cobra.go cli: NewTopLevelCommand: don't use unnamed assignments 2022-11-28 13:09:35 +01:00
cobra_test.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
error.go Import docker/docker/cli 2017-04-17 17:40:59 -04:00
required.go format (GoDoc) comments with Go 1.19 to prepare for go updates 2022-07-19 19:10:16 +02:00
required_test.go cli: remove deprecated io/ioutil 2022-02-25 15:42:19 +01:00