Review feedback

This commit is contained in:
Bryan Boreham committed 2015-12-01 16:47:47 +00:00
1 parent a22b88ed89
commit ec420c66d4
1 file changed
+5 -4
+5 -4
View File
@@ -1,7 +1,9 @@
package docker
import (
"errors"
"github.com/fsouza/go-dockerclient"
. "github.com/weaveworks/weave/common"
)
@@ -100,9 +102,8 @@ func (c *Client) GetContainerIP(nameOrID string) (string, error) {
} else if info.HostConfig.NetworkMode == "host" {
return "127.0.0.1", nil
}
if info.NetworkSettings.IPAddress == "" {
return "", errors.New("No IP address found for container " + nameOrID)
}
return info.NetworkSettings.IPAddress, nil
}
func (c *Client) InspectContainer(nameOrId string) (*docker.Container, error) {
return c.Client.InspectContainer(nameOrId)
}