Skip to content

Commit 298b953

Browse files
committed
cli/command: remove unused args from ResolveDefaultContext()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 68cad50 commit 298b953

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

cli/command/cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
214214
cli.contextStore = &ContextStoreWithDefault{
215215
Store: baseContextStore,
216216
Resolver: func() (*DefaultContext, error) {
217-
return ResolveDefaultContext(opts.Common, cli.ConfigFile(), cli.contextStoreConfig, cli.Err())
217+
return ResolveDefaultContext(opts.Common, cli.contextStoreConfig)
218218
},
219219
}
220220
cli.currentContext, err = resolveContextName(opts.Common, cli.configFile, cli.contextStore)
@@ -242,7 +242,7 @@ func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.
242242
contextStore := &ContextStoreWithDefault{
243243
Store: store.New(config.ContextStoreDir(), storeConfig),
244244
Resolver: func() (*DefaultContext, error) {
245-
return ResolveDefaultContext(opts, configFile, storeConfig, io.Discard)
245+
return ResolveDefaultContext(opts, storeConfig)
246246
},
247247
}
248248
contextName, err := resolveContextName(opts, configFile, contextStore)

cli/command/defaultcontextstore.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package command
22

33
import (
44
"fmt"
5-
"io"
65

7-
"github.com/docker/cli/cli/config/configfile"
86
"github.com/docker/cli/cli/context/docker"
97
"github.com/docker/cli/cli/context/store"
108
cliflags "github.com/docker/cli/cli/flags"
@@ -45,7 +43,7 @@ type EndpointDefaultResolver interface {
4543
}
4644

4745
// ResolveDefaultContext creates a Metadata for the current CLI invocation parameters
48-
func ResolveDefaultContext(opts *cliflags.CommonOptions, config *configfile.ConfigFile, storeconfig store.Config, stderr io.Writer) (*DefaultContext, error) {
46+
func ResolveDefaultContext(opts *cliflags.CommonOptions, config store.Config) (*DefaultContext, error) {
4947
contextTLSData := store.ContextTLSData{
5048
Endpoints: make(map[string]store.EndpointTLSData),
5149
}
@@ -66,7 +64,7 @@ func ResolveDefaultContext(opts *cliflags.CommonOptions, config *configfile.Conf
6664
contextTLSData.Endpoints[docker.DockerEndpoint] = *dockerEP.TLSData.ToStoreTLSData()
6765
}
6866

69-
if err := storeconfig.ForeachEndpointType(func(n string, get store.TypeGetter) error {
67+
if err := config.ForeachEndpointType(func(n string, get store.TypeGetter) error {
7068
if n == docker.DockerEndpoint { // handled above
7169
return nil
7270
}

0 commit comments

Comments
 (0)