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

Merge pull request #12609 from runcom/remove-not-needed-readHostConfig

Remove not needed call to container.readHostConfig()
This commit is contained in:
Alexander Morozov 2015-04-21 13:45:48 -07:00
commit 783dbcade3
2 changed files with 4 additions and 4 deletions

View file

@ -178,11 +178,13 @@ func (container *Container) readHostConfig() error {
return nil
}
data, err := ioutil.ReadFile(pth)
f, err := os.Open(pth)
if err != nil {
return err
}
return json.Unmarshal(data, container.hostConfig)
defer f.Close()
return json.NewDecoder(f).Decode(&container.hostConfig)
}
func (container *Container) WriteHostConfig() error {

View file

@ -194,8 +194,6 @@ func (daemon *Daemon) load(id string) (*Container, error) {
return container, fmt.Errorf("Container %s is stored at %s", container.ID, id)
}
container.readHostConfig()
return container, nil
}