mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02: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
|
||||
// any of the images, the associated containers are stopped and restarted with
|
||||
// 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")
|
||||
|
||||
containers, err := client.ListContainers(containerFilter(names))
|
||||
|
@ -86,8 +86,10 @@ func Update(client container.Client, names []string, cleanup bool) error {
|
|||
}
|
||||
}
|
||||
|
||||
if err := client.StartContainer(container); err != nil {
|
||||
log.Error(err)
|
||||
if !noRestart {
|
||||
if err := client.StartContainer(container); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
if cleanup {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue