diff --git a/docs/arguments.md b/docs/arguments.md index 58e7e7b..d0e46ae 100644 --- a/docs/arguments.md +++ b/docs/arguments.md @@ -234,6 +234,9 @@ Environment Variable: WATCHTOWER_NO_PULL Default: false ``` +Note that no-pull can also be specified on a per-container basis with the +`com.centurylinklabs.watchtower.no-pull` label set on those containers. + ## Without sending a startup message Do not send a message after watchtower started. Otherwise there will be an info-level notification. diff --git a/pkg/container/container_test.go b/pkg/container/container_test.go index e75871b..736387d 100644 --- a/pkg/container/container_test.go +++ b/pkg/container/container_test.go @@ -207,6 +207,31 @@ var _ = Describe("the container", func() { }) }) + When("checking no-pull label", func() { + When("no-pull label is true", func() { + c := MockContainer(WithLabels(map[string]string{ + "com.centurylinklabs.watchtower.no-pull": "true", + })) + It("should return true", func() { + Expect(c.IsNoPull()).To(Equal(true)) + }) + }) + When("no-pull label is false", func() { + c := MockContainer(WithLabels(map[string]string{ + "com.centurylinklabs.watchtower.no-pull": "false", + })) + It("should return false", func() { + Expect(c.IsNoPull()).To(Equal(false)) + }) + }) + When("no-pull label is unset", func() { + c = MockContainer(WithLabels(map[string]string{})) + It("should return false", func() { + Expect(c.IsNoPull()).To(Equal(false)) + }) + }) + }) + When("there is a pre or post update timeout", func() { It("should return minute values", func() { c = MockContainer(WithLabels(map[string]string{