avoid saving container state to disk before daemon.Register

Migrate legacy volumes (Daemon.verifyVolumesInfo) before containers are
registered on the Daemon, so state on disk is not overwritten and legacy
fields lost during registration.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: 76d96418b13080514f3fb861072b06cb91d71cff
Component: engine
This commit is contained in:
Fabio Kung
2017-06-23 07:52:34 -07:00
parent 60fed1f9a7
commit cd24ef2d4a
4 changed files with 9 additions and 16 deletions
@@ -2684,7 +2684,7 @@ func (s *DockerDaemonSuite) TestDaemonBackcompatPre17Volumes(c *check.C) {
`)
configPath := filepath.Join(d.Root, "containers", id, "config.v2.json")
err = ioutil.WriteFile(configPath, config, 600)
c.Assert(ioutil.WriteFile(configPath, config, 600), checker.IsNil)
d.Start(c)
out, err = d.Cmd("inspect", "--type=container", "--format={{ json .Mounts }}", id)