mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
cmd/dockerd: use initialized config in tests
Makes sure that tests use a config struct that's more representative to how it's used in the code. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ff1b933d96
commit
2d7d81bc46
1 changed files with 5 additions and 4 deletions
|
@ -12,12 +12,13 @@ import (
|
|||
)
|
||||
|
||||
func defaultOptions(t *testing.T, configFile string) *daemonOptions {
|
||||
opts := newDaemonOptions(&config.Config{})
|
||||
cfg, err := config.New()
|
||||
assert.NilError(t, err)
|
||||
opts := newDaemonOptions(cfg)
|
||||
opts.flags = &pflag.FlagSet{}
|
||||
opts.installFlags(opts.flags)
|
||||
if err := installConfigFlags(opts.daemonConfig, opts.flags); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = installConfigFlags(opts.daemonConfig, opts.flags)
|
||||
assert.NilError(t, err)
|
||||
defaultDaemonConfigFile, err := getDefaultDaemonConfigFile()
|
||||
assert.NilError(t, err)
|
||||
opts.flags.StringVar(&opts.configFile, "config-file", defaultDaemonConfigFile, "")
|
||||
|
|
Loading…
Reference in a new issue