|
|
@ -34,7 +34,7 @@ func containerFilter(names []string) container.Filter {
|
|
|
|
// used to start those containers have been updated. If a change is detected in
|
|
|
|
// used to start those containers have been updated. If a change is detected in
|
|
|
|
// any of the images, the associated containers are stopped and restarted with
|
|
|
|
// any of the images, the associated containers are stopped and restarted with
|
|
|
|
// the new image.
|
|
|
|
// the new image.
|
|
|
|
func Update(client container.Client, names []string, cleanup bool) error {
|
|
|
|
func Update(client container.Client, names []string, cleanup bool, noRestart bool) error {
|
|
|
|
log.Info("Checking containers for updated images")
|
|
|
|
log.Info("Checking containers for updated images")
|
|
|
|
|
|
|
|
|
|
|
|
containers, err := client.ListContainers(containerFilter(names))
|
|
|
|
containers, err := client.ListContainers(containerFilter(names))
|
|
|
@ -86,9 +86,11 @@ func Update(client container.Client, names []string, cleanup bool) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !noRestart {
|
|
|
|
if err := client.StartContainer(container); err != nil {
|
|
|
|
if err := client.StartContainer(container); err != nil {
|
|
|
|
log.Error(err)
|
|
|
|
log.Error(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if cleanup {
|
|
|
|
if cleanup {
|
|
|
|
client.RemoveImage(container)
|
|
|
|
client.RemoveImage(container)
|
|
|
|