NewAPIClientFromFlags: rename variable to not collide with import

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-03-03 12:07:01 +01:00
parent d2ff0a58db
commit d35b50c0c3
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 3 deletions

View File

@ -271,17 +271,17 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
// NewAPIClientFromFlags creates a new APIClient from command line flags // NewAPIClientFromFlags creates a new APIClient from command line flags
func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) { func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) {
storeConfig := DefaultContextStoreConfig() storeConfig := DefaultContextStoreConfig()
store := &ContextStoreWithDefault{ contextStore := &ContextStoreWithDefault{
Store: store.New(cliconfig.ContextStoreDir(), storeConfig), Store: store.New(cliconfig.ContextStoreDir(), storeConfig),
Resolver: func() (*DefaultContext, error) { Resolver: func() (*DefaultContext, error) {
return ResolveDefaultContext(opts, configFile, storeConfig, io.Discard) return ResolveDefaultContext(opts, configFile, storeConfig, io.Discard)
}, },
} }
contextName, err := resolveContextName(opts, configFile, store) contextName, err := resolveContextName(opts, configFile, contextStore)
if err != nil { if err != nil {
return nil, err return nil, err
} }
endpoint, err := resolveDockerEndpoint(store, contextName) endpoint, err := resolveDockerEndpoint(contextStore, contextName)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "unable to resolve docker endpoint") return nil, errors.Wrap(err, "unable to resolve docker endpoint")
} }