feat: add no-pull label for containers (#1574)

Co-authored-by: Nedžad Alibegović <nedzad@nedzad.dev>
Co-authored-by: nils måsén <nils@piksel.se>
This commit is contained in:
Gilbert Gilb's 2023-03-12 10:07:24 +01:00 committed by GitHub
parent 6ace7bd0dd
commit bbbe04119c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 13 deletions

View file

@ -207,6 +207,39 @@ 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 set to an invalid value", func() {
c := MockContainer(WithLabels(map[string]string{
"com.centurylinklabs.watchtower.no-pull": "maybe",
}))
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{