Refactor to use Weave's docker client and watcher

This commit is contained in:
Bryan Boreham committed 2015-11-30 13:25:20 +00:00
1 parent 068bbe0837
commit bd2b8df7c5
6 files changed
+25 -42

No files matched your search

+13
View File
@@ -80,3 +80,16 @@ func (c *Client) IsContainerNotRunning(idStr string) bool {
Log.Errorf("[docker] Could not check container status: %s", err)
return false
}
func (c *Client) GetContainerBridgeIP(nameOrID string) (string, error) {
Log.Debugf("Getting IP for container %s", nameOrID)
info, err := c.InspectContainer(nameOrID)
if err != nil {
return "", err
}
return info.NetworkSettings.IPAddress, nil
}
func (c *Client) InspectContainer(nameOrId string) (*docker.Container, error) {
return c.Client.InspectContainer(nameOrId)
}