Browse Source

Remove not needed call to container.readHostConfig()

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Antonio Murdaca 10 years ago
parent
commit
a3c4801c92
2 changed files with 4 additions and 4 deletions
  1. 4 2
      daemon/container.go
  2. 0 2
      daemon/daemon.go

+ 4 - 2
daemon/container.go

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

+ 0 - 2
daemon/daemon.go

@@ -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)
 		return container, fmt.Errorf("Container %s is stored at %s", container.ID, id)
 	}
 	}
 
 
-	container.readHostConfig()
-
 	return container, nil
 	return container, nil
 }
 }