mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 14:10:12 +01:00
Skip restarting
This commit is contained in:
parent
ad32d1c677
commit
ac7375a1da
1 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue