mirror of
https://github.com/docker/compose.git
synced 2026-08-04 14:47:40 +00:00
test fix
Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
parent
f0fd18eec9
commit
6458b97089
3 changed files with 19 additions and 30 deletions
|
|
@ -21,13 +21,11 @@ import (
|
|||
|
||||
"golang.org/x/net/context"
|
||||
|
||||
configfile "github.com/docker/cli/cli/config/configfile"
|
||||
cliflags "github.com/docker/cli/cli/flags"
|
||||
)
|
||||
|
||||
type currentContextKey struct{}
|
||||
type cliOptionsKey struct{}
|
||||
type configKey struct{}
|
||||
|
||||
// WithCurrentContext sets the name of the current docker context
|
||||
func WithCurrentContext(ctx gocontext.Context, contextName string) context.Context {
|
||||
|
|
@ -50,14 +48,3 @@ func CliOptions(ctx context.Context) cliflags.CommonOptions {
|
|||
cc, _ := ctx.Value(cliOptionsKey{}).(cliflags.CommonOptions)
|
||||
return cc
|
||||
}
|
||||
|
||||
// WithConfig sets docker config
|
||||
func WithConfig(ctx gocontext.Context, config configfile.ConfigFile) context.Context {
|
||||
return context.WithValue(ctx, configKey{}, config)
|
||||
}
|
||||
|
||||
// Config returns the docker config
|
||||
func Config(ctx context.Context) configfile.ConfigFile {
|
||||
cc, _ := ctx.Value(cliOptionsKey{}).(configfile.ConfigFile)
|
||||
return cc
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue