Change CommonOptions (deprecated) to ClientOptions and remove unneeded parameters.
This commit is contained in:
parent
4d2a1065d2
commit
43ecf35449
|
@ -8,22 +8,19 @@ import (
|
||||||
"github.com/docker/cli/cli/context"
|
"github.com/docker/cli/cli/context"
|
||||||
contextStore "github.com/docker/cli/cli/context/store"
|
contextStore "github.com/docker/cli/cli/context/store"
|
||||||
cliflags "github.com/docker/cli/cli/flags"
|
cliflags "github.com/docker/cli/cli/flags"
|
||||||
"github.com/moby/term"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewDefaultDockerContextStore() *command.ContextStoreWithDefault {
|
func NewDefaultDockerContextStore() *command.ContextStoreWithDefault {
|
||||||
_, _, stderr := term.StdStreams()
|
|
||||||
dockerConfig := dConfig.LoadDefaultConfigFile(stderr)
|
|
||||||
contextDir := dConfig.ContextStoreDir()
|
contextDir := dConfig.ContextStoreDir()
|
||||||
storeConfig := command.DefaultContextStoreConfig()
|
storeConfig := command.DefaultContextStoreConfig()
|
||||||
store := newContextStore(contextDir, storeConfig)
|
store := newContextStore(contextDir, storeConfig)
|
||||||
|
|
||||||
opts := &cliflags.CommonOptions{Context: "default"}
|
opts := &cliflags.ClientOptions{Context: "default"}
|
||||||
|
|
||||||
dockerContextStore := &command.ContextStoreWithDefault{
|
dockerContextStore := &command.ContextStoreWithDefault{
|
||||||
Store: store,
|
Store: store,
|
||||||
Resolver: func() (*command.DefaultContext, error) {
|
Resolver: func() (*command.DefaultContext, error) {
|
||||||
return command.ResolveDefaultContext(opts, dockerConfig, storeConfig, stderr)
|
return command.ResolveDefaultContext(opts, storeConfig)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue