DockerCLI/cli/command/system
Ian Campbell 8635abd662 Use underlying `NewKubernetesConfig` directly from compose-on-kubernetes.
The comment on `github.com/docker/cli/kubernetes.NewKubernetesConfig` said:

    // Deprecated: Use github.com/docker/compose-on-kubernetes/api.NewKubernetesConfig instead

By making this switch in `github.com/docker/cli/context/kubernetes/load.go` we
break a vendoring chain:

`github.com/docker/cli/cli/command`
→ `vendor/github.com/docker/cli/cli/context/kubernetes/load.go`
  → `vendor/github.com/docker/cli/kubernetes`
     → `github.com/docker/compose-on-kubernetes/api/compose/...`

This means that projects which just want `github.com/docker/cli/cli/command`
(which is itself pulled in transitively by
`github.com/docker/cli/cli-plugins/plugin`) which do not themselves need the
compose-on-kubernetes API avoid a huge pile of transitive dependencies.

On one of my private projects the diff on the vendor dir is:

    280 files changed, 21 insertions(+), 211346 deletions(-)

and includes dropping:

* `github.com/docker/compose-on-kubernetes/api/compose/{clone,impersonation}`
* `github.com/docker/compose-on-kubernetes/api/compose/{v1alpha3,v1beta1,v1beta2,v1beta3}`
* `github.com/google/btree`
* `github.com/googleapis/gnostic`
* `github.com/gregjones/httpcache`
* `github.com/peterbourgon/diskv`
* `k8s.io/api/*` (_lots_ of subpackages)
* `k8s.io/client-go/{discovery,kubernetes/scheme}`

and I've gone from:

    $ du -sh vendor/k8s.io/
    8.1M	vendor/k8s.io/

to:

    $ du -sh vendor/k8s.io/
    2.1M	vendor/k8s.io/

(overall I went from 36M → 29M of vendor dir for this particular project)

The change to `cli/command/system/version.go` is just for consistency and
allows us to drop the now unused alias.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-05-14 15:43:15 +01:00
..
testdata Update docker/docker to 827cb09f87964ed38b46502f22a585f2ed4a78e1 2019-03-19 22:21:51 +01:00
client_test.go Switch from x/net/context to context 2018-05-11 16:49:43 -07:00
cmd.go Revert "Disable `docker system dial-stdio` on Windows" 2019-03-12 14:57:52 +00:00
df.go system/df: allow -v with --format 2018-09-13 23:14:58 +00:00
dial_stdio.go dial-stdio: fix goroutine leakage 2019-03-22 20:22:00 +09:00
events.go Switch from x/net/context to context 2018-05-11 16:49:43 -07:00
info.go Reformat the output of CLI plugins in `docker system info` 2019-02-25 13:13:51 +00:00
info_test.go Reformat the output of CLI plugins in `docker system info` 2019-02-25 13:13:51 +00:00
inspect.go Use command.Cli interface instead of concrete type… 2018-06-14 16:26:47 +02:00
prune.go Make system prune warning filters human-readable 2019-03-18 13:57:18 +01:00
prune_test.go Make system prune warning filters human-readable 2019-03-18 13:57:18 +01:00
version.go Use underlying `NewKubernetesConfig` directly from compose-on-kubernetes. 2019-05-14 15:43:15 +01:00
version_test.go Extend version-align test with components 2018-07-12 01:31:23 +02:00