DockerCLI/cli/command
Ian Campbell ec7a9ad6e4 Dynamically register kubernetes context store endpoint type.
This removes the need for the core context code to import
`github.com/docker/cli/cli/context/kubernetes` which in turn reduces the
transitive import tree in this file to not pull in all of Kubernetes.

Note that this means that any calling code which is interested in the
kubernetes endpoint must import `github.com/docker/cli/cli/context/kubernetes`
itself somewhere in order to trigger the dynamic registration. In practice
anything which is interested in Kubernetes must import that package (e.g.
`./cli/command/context.list` does for the `EndpointFromContext` function) to do
anything useful, so this restriction is not too onerous.

As a special case a small amount of Kubernetes related logic remains in
`ResolveDefaultContext` to handle error handling when the stack orchestrator
includes Kubernetes. In order to avoid a circular import loop this hardcodes
the kube endpoint name.

Similarly to avoid an import loop the existing `TestDefaultContextInitializer`
cannot continue to unit test for the Kubernetes case, so that aspect of the
test is carved off into a very similar test in the kubernetes context package.

Lastly, note that the kubernetes endpoint is now modifiable via
`WithContextEndpointType`.

Signed-off-by: Ian Campbell <ijc@docker.com>
(cherry picked from commit 520be05c49)
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2019-05-24 15:55:50 +02:00
..
builder cli-plugins: alias an existing allowed command (only builder for now) 2019-04-19 01:26:45 +00:00
bundlefile Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00
checkpoint formatter package heavy refactoring 2018-10-23 17:05:44 +02:00
commands Merge pull request #1602 from thaJeztah/hide_experimental_deploy 2019-02-08 13:53:12 -08:00
config Fix annnotation on docker config create --template-driver 2019-03-21 16:19:06 +01:00
container add cli integration for unconfined systempaths with unit test, implement suggested changes 2019-04-05 15:46:15 +02:00
context Cleanup context store interfaces 2019-04-18 15:49:36 +02:00
engine Remove e-mail from trial flow 2019-01-08 00:35:24 +01:00
formatter Fast Context Switch: commands 2019-01-10 22:25:43 +01:00
idresolver Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00
image vendor buildkit to f238f1e 2019-05-13 18:43:13 -07:00
inspect Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00
manifest Add bash completion for `manifest` command family 2018-08-30 08:54:49 +02:00
network Refactor network parsing, add preliminary support for multiple networks 2019-04-03 16:42:57 +02:00
node Fix tests with missing mocks 2018-11-08 11:37:49 +01:00
plugin Update docker/docker to 827cb09f87964ed38b46502f22a585f2ed4a78e1 2019-03-19 22:21:51 +01:00
registry Add unit test coverage for token auth 2019-04-15 16:13:55 -07:00
secret Fix annotation on docker secret create --template-driver 2019-03-28 16:18:50 +01:00
service Switch to google/shlex 2019-04-13 17:51:15 +02:00
stack Regroup all kubernetes extra-fields under x-kubernetes 2019-04-12 15:46:11 +02:00
swarm Extract streams helpers from command package to their own package to remove a cyclic dependency from command to internal/containerizedengine 2019-01-28 14:36:00 +01:00
system Use underlying `NewKubernetesConfig` directly from compose-on-kubernetes. 2019-05-20 18:14:36 +02:00
task formatter package heavy refactoring 2018-10-23 17:05:44 +02:00
testdata Dynamically register kubernetes context store endpoint type. 2019-05-24 15:55:50 +02:00
trust Fix tests with missing mocks 2018-11-08 11:37:49 +01:00
volume Fix labels copying value from environment variables 2019-03-19 03:01:57 +01:00
cli.go Dynamically register kubernetes context store endpoint type. 2019-05-24 15:55:50 +02:00
cli_options.go Dynamically register kubernetes context store endpoint type. 2019-05-24 15:55:50 +02:00
cli_options_test.go Unit test for WithContentTrustFromEnv 2019-01-29 11:26:40 +00:00
cli_test.go Cover the changes with unit test 2019-03-13 14:18:41 +01:00
context.go Cleanup context store interfaces 2019-04-18 15:49:36 +02:00
defaultcontextstore.go Dynamically register kubernetes context store endpoint type. 2019-05-24 15:55:50 +02:00
defaultcontextstore_test.go Dynamically register kubernetes context store endpoint type. 2019-05-24 15:55:50 +02:00
events_utils.go updated vendoring 2017-09-01 19:41:06 -04:00
orchestrator.go Fast Context Switch: commands 2019-01-10 22:25:43 +01:00
orchestrator_test.go Introduce docker context store 2019-01-04 17:06:51 +01:00
registry.go Simplify ElectAuthServer 2019-03-28 21:08:13 +00:00
registry_test.go Remove docker api dependency from cli/config 2019-01-31 21:25:43 +00:00
streams.go Extract streams helpers from command package to their own package to remove a cyclic dependency from command to internal/containerizedengine 2019-01-28 14:36:00 +01:00
trust.go Refactor content_trust cli/flags handling 2018-03-08 15:00:43 -05:00
utils.go cli-plugins: alias an existing allowed command (only builder for now) 2019-04-19 01:26:45 +00:00
utils_test.go cli-plugins: alias an existing allowed command (only builder for now) 2019-04-19 01:26:45 +00:00