1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

daemon/config: New(): initialize config with platform-specific defaults

This centralizes more defaults, to be part of the config struct that's
created, instead of interweaving the defaults with other code in various
places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-06-06 21:11:08 +02:00
parent 724feb898f
commit b28e66cf4f
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
12 changed files with 102 additions and 106 deletions

View file

@ -24,7 +24,10 @@ func TestGetRuntime(t *testing.T) {
const configuredRtName = "my/custom.shim.v1"
configuredRuntime := types.Runtime{Path: "/bin/true"}
d := &Daemon{configStore: config.New()}
cfg, err := config.New()
assert.NilError(t, err)
d := &Daemon{configStore: cfg}
d.configStore.Root = t.TempDir()
assert.Assert(t, os.Mkdir(filepath.Join(d.configStore.Root, "runtimes"), 0700))
d.configStore.Runtimes = map[string]types.Runtime{