mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
fix cleanup for rolling updates (#706)
This commit is contained in:
parent
ea16683c46
commit
4d17cf1a29
2 changed files with 9 additions and 0 deletions
|
|
@ -73,6 +73,7 @@ func performRollingRestart(containers []container.Container, client container.Cl
|
||||||
if containers[i].Stale {
|
if containers[i].Stale {
|
||||||
stopStaleContainer(containers[i], client, params)
|
stopStaleContainer(containers[i], client, params)
|
||||||
restartStaleContainer(containers[i], client, params)
|
restartStaleContainer(containers[i], client, params)
|
||||||
|
cleanupImageIDs[containers[i].ImageID()] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,14 @@ var _ = Describe("the update action", func() {
|
||||||
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(2))
|
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(2))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
When("performing a rolling restart update", func() {
|
||||||
|
It("should try to remove the image once", func() {
|
||||||
|
|
||||||
|
err := actions.Update(client, types.UpdateParams{Cleanup: true, RollingRestart: true})
|
||||||
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(1))
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
When("watchtower has been instructed to monitor only", func() {
|
When("watchtower has been instructed to monitor only", func() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue