diff --git a/cmd/root.go b/cmd/root.go index 22a0d6d..10023f4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -7,10 +7,10 @@ import ( "syscall" "time" - "github.com/containrrr/watchtower/actions" - "github.com/containrrr/watchtower/pkg/container" "github.com/containrrr/watchtower/internal/flags" "github.com/containrrr/watchtower/notifications" + "github.com/containrrr/watchtower/pkg/actions" + "github.com/containrrr/watchtower/pkg/container" t "github.com/containrrr/watchtower/pkg/types" "github.com/robfig/cron" log "github.com/sirupsen/logrus" diff --git a/actions/actions_suite_test.go b/pkg/actions/actions_suite_test.go similarity index 91% rename from actions/actions_suite_test.go rename to pkg/actions/actions_suite_test.go index 93fd417..c0e07f7 100644 --- a/actions/actions_suite_test.go +++ b/pkg/actions/actions_suite_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - "github.com/containrrr/watchtower/actions" "github.com/containrrr/watchtower/pkg/container" "github.com/containrrr/watchtower/pkg/container/mocks" "github.com/docker/docker/api/types" @@ -44,7 +43,7 @@ var _ = Describe("the actions package", func() { When("given an empty array", func() { It("should not do anything", func() { client.TestData.Containers = []container.Container{} - err := actions.CheckForMultipleWatchtowerInstances(client, false) + err := CheckForMultipleWatchtowerInstances(client, false) Expect(err).NotTo(HaveOccurred()) }) }) @@ -57,7 +56,7 @@ var _ = Describe("the actions package", func() { "watchtower", time.Now()), } - err := actions.CheckForMultipleWatchtowerInstances(client, false) + err := CheckForMultipleWatchtowerInstances(client, false) Expect(err).NotTo(HaveOccurred()) }) }) @@ -85,7 +84,7 @@ var _ = Describe("the actions package", func() { } }) It("should stop all but the latest one", func() { - err := actions.CheckForMultipleWatchtowerInstances(client, false) + err := CheckForMultipleWatchtowerInstances(client, false) Expect(err).NotTo(HaveOccurred()) }) }) @@ -112,12 +111,12 @@ var _ = Describe("the actions package", func() { } }) It("should try to delete the image if the cleanup flag is true", func() { - err := actions.CheckForMultipleWatchtowerInstances(client, true) + err := CheckForMultipleWatchtowerInstances(client, true) Expect(err).NotTo(HaveOccurred()) Expect(client.TestData.TriedToRemoveImage).To(BeTrue()) }) It("should not try to delete the image if the cleanup flag is false", func() { - err := actions.CheckForMultipleWatchtowerInstances(client, false) + err := CheckForMultipleWatchtowerInstances(client, false) Expect(err).NotTo(HaveOccurred()) Expect(client.TestData.TriedToRemoveImage).To(BeFalse()) }) diff --git a/actions/check.go b/pkg/actions/check.go similarity index 100% rename from actions/check.go rename to pkg/actions/check.go diff --git a/actions/update.go b/pkg/actions/update.go similarity index 100% rename from actions/update.go rename to pkg/actions/update.go