|
|
|
@ -13,7 +13,6 @@ import (
|
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _ = Describe("the update action", func() {
|
|
|
|
|
var dockerClient cli.CommonAPIClient
|
|
|
|
|
var client MockClient
|
|
|
|
@ -25,7 +24,6 @@ var _ = Describe("the update action", func() {
|
|
|
|
|
cli.WithHTTPClient(server.Client()))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
When("watchtower has been instructed to clean up", func() {
|
|
|
|
|
BeforeEach(func() {
|
|
|
|
|
pullImages := false
|
|
|
|
@ -60,7 +58,7 @@ var _ = Describe("the update action", func() {
|
|
|
|
|
When("there are multiple containers using the same image", func() {
|
|
|
|
|
It("should only try to remove the image once", func() {
|
|
|
|
|
|
|
|
|
|
err := actions.Update(client, types.UpdateParams{ Cleanup: true })
|
|
|
|
|
err := actions.Update(client, types.UpdateParams{Cleanup: true})
|
|
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
|
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(1))
|
|
|
|
|
})
|
|
|
|
@ -76,7 +74,7 @@ var _ = Describe("the update action", func() {
|
|
|
|
|
time.Now(),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
err := actions.Update(client, types.UpdateParams{ Cleanup: true })
|
|
|
|
|
err := actions.Update(client, types.UpdateParams{Cleanup: true})
|
|
|
|
|
Expect(err).NotTo(HaveOccurred())
|
|
|
|
|
Expect(client.TestData.TriedToRemoveImageCount).To(Equal(2))
|
|
|
|
|
})
|
|
|
|
|