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:
Simon Aronsson 2021-04-18 18:37:35 +02:00 committed by GitHub
parent 4142f7966a
commit 3de202a965
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 83 additions and 29 deletions

View file

@ -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