mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
fix: gracefully skip pinned images (#1277)
* move client args to opts struct * gracefully skip pinned images * replace newClientNoAPI with literals
This commit is contained in:
parent
de40b0ce11
commit
e983beb52a
4 changed files with 98 additions and 88 deletions
|
@ -216,20 +216,20 @@ var _ = Describe("the container", func() {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
When("there is a pre or post update timeout", func() {
|
||||
It("should return minute values", func() {
|
||||
c = mockContainerWithLabels(map[string]string{
|
||||
"com.centurylinklabs.watchtower.lifecycle.pre-update-timeout": "3",
|
||||
"com.centurylinklabs.watchtower.lifecycle.post-update-timeout": "5",
|
||||
})
|
||||
preTimeout := c.PreUpdateTimeout()
|
||||
Expect(preTimeout).To(Equal(3))
|
||||
postTimeout := c.PostUpdateTimeout()
|
||||
Expect(postTimeout).To(Equal(5))
|
||||
})
|
||||
})
|
||||
|
||||
It("should return minute values", func() {
|
||||
c = mockContainerWithLabels(map[string]string{
|
||||
"com.centurylinklabs.watchtower.lifecycle.pre-update-timeout": "3",
|
||||
"com.centurylinklabs.watchtower.lifecycle.post-update-timeout": "5",
|
||||
})
|
||||
preTimeout := c.PreUpdateTimeout()
|
||||
Expect(preTimeout).To(Equal(3))
|
||||
postTimeout := c.PostUpdateTimeout()
|
||||
Expect(postTimeout).To(Equal(5))
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -282,15 +282,3 @@ func mockContainerWithLabels(labels map[string]string) *Container {
|
|||
}
|
||||
return NewContainer(&content, nil)
|
||||
}
|
||||
|
||||
func newClientNoAPI(pullImages, includeStopped, reviveStopped, removeVolumes, includeRestarting bool, warnOnHeadFailed string) Client {
|
||||
return dockerClient{
|
||||
api: nil,
|
||||
pullImages: pullImages,
|
||||
removeVolumes: removeVolumes,
|
||||
includeStopped: includeStopped,
|
||||
reviveStopped: reviveStopped,
|
||||
includeRestarting: includeRestarting,
|
||||
warnOnHeadFailed: warnOnHeadFailed,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue