mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
fix depends on behavior and simplify some of its logic (#908)
* fix depends on behavior and simplify some of its logic * fix comments
This commit is contained in:
parent
4142f7966a
commit
3de202a965
5 changed files with 83 additions and 29 deletions
|
@ -22,8 +22,8 @@ func NewContainer(containerInfo *types.ContainerJSON, imageInfo *types.ImageInsp
|
|||
|
||||
// Container represents a running Docker container.
|
||||
type Container struct {
|
||||
Linked bool
|
||||
Stale bool
|
||||
LinkedToRestarting bool
|
||||
Stale bool
|
||||
|
||||
containerInfo *types.ContainerJSON
|
||||
imageInfo *types.ImageInspect
|
||||
|
@ -142,7 +142,7 @@ func (c Container) Links() []string {
|
|||
// ToRestart return whether the container should be restarted, either because
|
||||
// is stale or linked to another stale container.
|
||||
func (c Container) ToRestart() bool {
|
||||
return c.Stale || c.Linked
|
||||
return c.Stale || c.LinkedToRestarting
|
||||
}
|
||||
|
||||
// IsWatchtower returns a boolean flag indicating whether or not the current
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue