Sync 'owned' data with existing containers at startup

This commit is contained in:
Bryan Boreham committed 2016-03-02 11:35:24 -08:00
1 parent f29716387f
commit 95cbc8940e
3 files changed
+42

No files matched your search

+12
View File
@@ -94,6 +94,18 @@ func (c *Client) AddObserver(ob ContainerObserver) error {
return nil
}
func (c *Client) AllContainerIDs() ([]string, error) {
all, err := c.ListContainers(docker.ListContainersOptions{All: true})
if err != nil {
return nil, err
}
var ids []string
for _, c := range all {
ids = append(ids, c.ID)
}
return ids, nil
}
// IsContainerNotRunning returns true if we have checked with Docker that the ID is not running
func (c *Client) IsContainerNotRunning(idStr string) bool {
container, err := c.InspectContainer(idStr)