add docs and tests for no-pull label

This commit is contained in:
Gilbert Gilb's 2023-03-06 11:24:08 +01:00
parent 75cc6b8c65
commit fb8dd3b04e
2 changed files with 28 additions and 0 deletions

View file

@ -234,6 +234,9 @@ Environment Variable: WATCHTOWER_NO_PULL
Default: false 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 ## Without sending a startup message
Do not send a message after watchtower started. Otherwise there will be an info-level notification. Do not send a message after watchtower started. Otherwise there will be an info-level notification.

View file

@ -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() { When("there is a pre or post update timeout", func() {
It("should return minute values", func() { It("should return minute values", func() {
c = MockContainer(WithLabels(map[string]string{ c = MockContainer(WithLabels(map[string]string{