mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-28 20:58:48 +01:00
Add a label take precedence argument
This commit is contained in:
parent
36391b0ae7
commit
82f5472fd6
6 changed files with 85 additions and 30 deletions
|
|
@ -182,8 +182,41 @@ var _ = Describe("the update action", func() {
|
|||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(0))
|
||||
})
|
||||
})
|
||||
|
||||
When("watchtower has been instructed to have label take precedence", func() {
|
||||
It("it should update containers with monitor only set to false", func() {
|
||||
client := CreateMockClient(
|
||||
&TestData{
|
||||
NameOfContainerToKeep: "test-container-02",
|
||||
Containers: []types.Container{
|
||||
CreateMockContainer(
|
||||
"test-container-01",
|
||||
"test-container-01",
|
||||
"fake-image1:latest",
|
||||
time.Now()),
|
||||
CreateMockContainerWithConfig(
|
||||
"test-container-02",
|
||||
"test-container-02",
|
||||
"fake-image2:latest",
|
||||
false,
|
||||
false,
|
||||
time.Now(),
|
||||
&dockerContainer.Config{
|
||||
Labels: map[string]string{
|
||||
"com.centurylinklabs.watchtower.monitor-only": "false",
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
false,
|
||||
false,
|
||||
)
|
||||
_, err := actions.Update(client, types.UpdateParams{MonitorOnly: true, LabelPrecedence: true})
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(1))
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
When("watchtower has been instructed to run lifecycle hooks", func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue