Skip to content

Commit

Permalink
Merge pull request #1887 from ijc/reduce-vendoring-impact
Browse files Browse the repository at this point in the history
Allow vendorers of docker/cli to avoid transitively pulling in a big chunk if k8s too
  • Loading branch information
thaJeztah authored May 20, 2019
2 parents 031d2f8 + 8635abd commit 57aa773
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions cli/command/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/docker/cli/cli/config/configfile"
dcontext "github.com/docker/cli/cli/context"
"github.com/docker/cli/cli/context/docker"
kubcontext "github.com/docker/cli/cli/context/kubernetes"
kubecontext "github.com/docker/cli/cli/context/kubernetes"
"github.com/docker/cli/cli/context/store"
"github.com/docker/cli/cli/debug"
cliflags "github.com/docker/cli/cli/flags"
Expand Down Expand Up @@ -530,6 +530,6 @@ func defaultContextStoreConfig() store.Config {
return store.NewConfig(
func() interface{} { return &DockerContext{} },
store.EndpointTypeGetter(docker.DockerEndpoint, func() interface{} { return &docker.EndpointMeta{} }),
store.EndpointTypeGetter(kubcontext.KubernetesEndpoint, func() interface{} { return &kubcontext.EndpointMeta{} }),
store.EndpointTypeGetter(kubecontext.KubernetesEndpoint, func() interface{} { return &kubecontext.EndpointMeta{} }),
)
}
3 changes: 2 additions & 1 deletion cli/command/system/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/docker/cli/cli/version"
"github.com/docker/cli/kubernetes"
"github.com/docker/cli/templates"
kubeapi "github.com/docker/compose-on-kubernetes/api"
"github.com/docker/docker/api/types"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -243,7 +244,7 @@ func getKubernetesVersion(dockerCli command.Cli, kubeConfig string) *kubernetesV
err error
)
if dockerCli.CurrentContext() == "" {
clientConfig = kubernetes.NewKubernetesConfig(kubeConfig)
clientConfig = kubeapi.NewKubernetesConfig(kubeConfig)
} else {
clientConfig, err = kubecontext.ConfigFromContext(dockerCli.CurrentContext(), dockerCli.ContextStore())
}
Expand Down
4 changes: 2 additions & 2 deletions cli/context/kubernetes/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kubernetes
import (
"github.com/docker/cli/cli/context"
"github.com/docker/cli/cli/context/store"
"github.com/docker/cli/kubernetes"
api "github.com/docker/compose-on-kubernetes/api"
"k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)
Expand Down Expand Up @@ -91,5 +91,5 @@ func ConfigFromContext(name string, s store.Reader) (clientcmd.ClientConfig, err
return ep.KubernetesConfig(), nil
}
// context has no kubernetes endpoint
return kubernetes.NewKubernetesConfig(""), nil
return api.NewKubernetesConfig(""), nil
}
8 changes: 0 additions & 8 deletions kubernetes/config.go

This file was deleted.

0 comments on commit 57aa773

Please sign in to comment.