diff --git a/internal/actions/update_test.go b/internal/actions/update_test.go index 9209dcd..c09d4ba 100644 --- a/internal/actions/update_test.go +++ b/internal/actions/update_test.go @@ -371,7 +371,7 @@ var _ = Describe("the update action", func() { ExposedPorts: map[nat.Port]struct{}{}, }) - provider.SetStale(true) + provider.SetMarkedForUpdate(true) consumer := CreateMockContainerWithConfig( "test-container-consumer", diff --git a/pkg/container/container.go b/pkg/container/container.go index 000a33d..91067da 100644 --- a/pkg/container/container.go +++ b/pkg/container/container.go @@ -27,31 +27,31 @@ func NewContainer(containerInfo *types.ContainerJSON, imageInfo *types.ImageInsp // Container represents a running Docker container. type Container struct { - LinkedToRestarting bool - Stale bool + linkedToRestarting bool + markedForUpdate bool containerInfo *types.ContainerJSON imageInfo *types.ImageInspect } -// IsLinkedToRestarting returns the current value of the LinkedToRestarting field for the container +// IsLinkedToRestarting returns the current value of the linkedToRestarting field for the container func (c *Container) IsLinkedToRestarting() bool { - return c.LinkedToRestarting + return c.linkedToRestarting } -// IsStale returns the current value of the Stale field for the container -func (c *Container) IsStale() bool { - return c.Stale +// IsMarkedForUpdate returns the current value of the markedForUpdate field for the container +func (c *Container) IsMarkedForUpdate() bool { + return c.markedForUpdate } -// SetLinkedToRestarting sets the LinkedToRestarting field for the container +// SetLinkedToRestarting sets the linkedToRestarting field for the container func (c *Container) SetLinkedToRestarting(value bool) { - c.LinkedToRestarting = value + c.linkedToRestarting = value } -// SetStale implements sets the Stale field for the container -func (c *Container) SetStale(value bool) { - c.Stale = value +// SetMarkedForUpdate sets the markedForUpdate field for the container +func (c *Container) SetMarkedForUpdate(value bool) { + c.markedForUpdate = value } // ContainerInfo fetches JSON info for the container @@ -208,7 +208,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.LinkedToRestarting + return c.markedForUpdate || c.linkedToRestarting } // IsWatchtower returns a boolean flag indicating whether or not the current diff --git a/pkg/types/container.go b/pkg/types/container.go index cc8be9f..3c00fb0 100644 --- a/pkg/types/container.go +++ b/pkg/types/container.go @@ -64,8 +64,8 @@ type Container interface { GetLifecycleCommand(LifecyclePhase) string GetLifecycleTimeout(LifecyclePhase) time.Duration VerifyConfiguration() error - SetStale(bool) - IsStale() bool + SetMarkedForUpdate(bool) + IsMarkedForUpdate() bool IsNoPull(UpdateParams) bool SetLinkedToRestarting(bool) IsLinkedToRestarting() bool