From 9aecd33f24e07f7b53571ba584bbacdcd3e18712 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:58:49 +0100 Subject: [PATCH 01/27] chore(deps): bump github.com/docker/docker from 24.0.6+incompatible to 24.0.7+incompatible (#1816) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c5fe761..06343c3 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/containrrr/shoutrrr v0.8.0 github.com/distribution/reference v0.5.0 github.com/docker/cli v24.0.6+incompatible - github.com/docker/docker v24.0.6+incompatible + github.com/docker/docker v24.0.7+incompatible github.com/docker/go-connections v0.4.0 github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.28.1 diff --git a/go.sum b/go.sum index beebe5e..abd5f2b 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWT github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.6+incompatible h1:hceabKCtUgDqPu+qm0NgsaXf28Ljf4/pWFL7xjWWDgE= -github.com/docker/docker v24.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.1 h1:Dq4iIfcM7cNtddhLVWe9h4QDjsi4OER3Z8voPu/I52g= github.com/docker/docker-credential-helpers v0.6.1/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= From bd9d7309d1732aecb488c73e3d459e932ca3f0d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 00:07:11 +0100 Subject: [PATCH 02/27] chore(deps): bump github.com/onsi/gomega from 1.28.1 to 1.29.0 (#1818) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 06343c3..70abe70 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/docker/docker v24.0.7+incompatible github.com/docker/go-connections v0.4.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.28.1 + github.com/onsi/gomega v1.29.0 github.com/prometheus/client_golang v1.17.0 github.com/robfig/cron v1.2.0 github.com/sirupsen/logrus v1.9.3 diff --git a/go.sum b/go.sum index abd5f2b..fc2e21e 100644 --- a/go.sum +++ b/go.sum @@ -203,8 +203,8 @@ github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042 github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= -github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= From 887569f4534952ce5441f29a0c5b0af592bd85ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 00:07:27 +0100 Subject: [PATCH 03/27] chore(deps): bump github.com/docker/cli from 24.0.6+incompatible to 24.0.7+incompatible (#1817) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 70abe70..c9fdd0e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/containrrr/shoutrrr v0.8.0 github.com/distribution/reference v0.5.0 - github.com/docker/cli v24.0.6+incompatible + github.com/docker/cli v24.0.7+incompatible github.com/docker/docker v24.0.7+incompatible github.com/docker/go-connections v0.4.0 github.com/onsi/ginkgo v1.16.5 diff --git a/go.sum b/go.sum index fc2e21e..730260c 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= -github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= +github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= From 7fb04d041139cea7d13377ff30673bb5d7d69295 Mon Sep 17 00:00:00 2001 From: Andrii Bratanin Date: Sat, 11 Nov 2023 15:34:33 +0200 Subject: [PATCH 04/27] docs: fix list formatting in container-selection (#1380) --- docs/container-selection.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/container-selection.md b/docs/container-selection.md index 4b6facd..8327c66 100644 --- a/docs/container-selection.md +++ b/docs/container-selection.md @@ -58,6 +58,7 @@ If instead you want to [only include containers with the enable label](https://c If you wish to create a monitoring scope, you will need to [run multiple instances and set a scope for each of them](https://containrrr.github.io/watchtower/running-multiple-instances). Watchtower filters running containers by testing them against each configured criteria. A container is monitored if all criteria are met. For example: + - If a container's name is on the monitoring name list (not empty `--name` argument) but it is not enabled (_centurylinklabs.watchtower.enable=false_), it won't be monitored; - If a container's name is not on the monitoring name list (not empty `--name` argument), even if it is enabled (_centurylinklabs.watchtower.enable=true_ and `--label-enable` flag is set), it won't be monitored; From 48539c4faf96ae9d93d40bcf5dedc1812fdfa19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Sat, 11 Nov 2023 14:50:43 +0100 Subject: [PATCH 05/27] fix: set nopull param from args (#1830) --- cmd/root.go | 7 ++++--- pkg/container/client.go | 1 - pkg/container/client_test.go | 23 ++++++++++++----------- pkg/notifications/shoutrrr.go | 4 ++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 48961d2..eef13ce 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -33,6 +33,7 @@ var ( scheduleSpec string cleanup bool noRestart bool + noPull bool monitorOnly bool enableLabel bool disableContainers []string @@ -110,7 +111,7 @@ func PreRun(cmd *cobra.Command, _ []string) { log.Fatal(err) } - noPull, _ := f.GetBool("no-pull") + noPull, _ = f.GetBool("no-pull") includeStopped, _ := f.GetBool("include-stopped") includeRestarting, _ := f.GetBool("include-restarting") reviveStopped, _ := f.GetBool("revive-stopped") @@ -122,7 +123,6 @@ func PreRun(cmd *cobra.Command, _ []string) { } client = container.NewClient(container.ClientOptions{ - PullImages: !noPull, IncludeStopped: includeStopped, ReviveStopped: reviveStopped, RemoveVolumes: removeVolumes, @@ -187,7 +187,7 @@ func Run(c *cobra.Command, names []string) { metrics.RegisterScan(metric) }, updateLock) httpAPI.RegisterFunc(updateHandler.Path, updateHandler.Handle) - // If polling isn't enabled the scheduler is never started and + // If polling isn't enabled the scheduler is never started, and // we need to trigger the startup messages manually. if !unblockHTTPAPI { writeStartupMessage(c, time.Time{}, filterDesc) @@ -367,6 +367,7 @@ func runUpdatesWithNotifications(filter t.Filter) *metrics.Metric { LifecycleHooks: lifecycleHooks, RollingRestart: rollingRestart, LabelPrecedence: labelPrecedence, + NoPull: noPull, } result, err := actions.Update(client, updateParams) if err != nil { diff --git a/pkg/container/client.go b/pkg/container/client.go index 51868e4..c6c37de 100644 --- a/pkg/container/client.go +++ b/pkg/container/client.go @@ -57,7 +57,6 @@ func NewClient(opts ClientOptions) Client { // ClientOptions contains the options for how the docker client wrapper should behave type ClientOptions struct { - PullImages bool RemoveVolumes bool IncludeStopped bool ReviveStopped bool diff --git a/pkg/container/client_test.go b/pkg/container/client_test.go index bcb261a..4e75409 100644 --- a/pkg/container/client_test.go +++ b/pkg/container/client_test.go @@ -70,7 +70,8 @@ var _ = Describe("the client", func() { It("should gracefully fail with a useful message", func() { c := dockerClient{} pinnedContainer := MockContainer(WithImageName("sha256:fa5269854a5e615e51a72b17ad3fd1e01268f278a6684c8ed3c5f0cdce3f230b")) - c.PullImage(context.Background(), pinnedContainer) + err := c.PullImage(context.Background(), pinnedContainer) + Expect(err).To(MatchError(`container uses a pinned image, and cannot be updated by watchtower`)) }) }) }) @@ -144,7 +145,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&mocks.Watchtower, &mocks.Running)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false}, + ClientOptions: ClientOptions{}, } containers, err := client.ListContainers(filters.NoFilter) Expect(err).NotTo(HaveOccurred()) @@ -158,7 +159,7 @@ var _ = Describe("the client", func() { filter := filters.FilterByNames([]string{"lollercoaster"}, filters.NoFilter) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false}, + ClientOptions: ClientOptions{}, } containers, err := client.ListContainers(filter) Expect(err).NotTo(HaveOccurred()) @@ -171,7 +172,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&mocks.Watchtower, &mocks.Running)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false}, + ClientOptions: ClientOptions{}, } containers, err := client.ListContainers(filters.WatchtowerContainersFilter) Expect(err).NotTo(HaveOccurred()) @@ -184,7 +185,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&mocks.Stopped, &mocks.Watchtower, &mocks.Running)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false, IncludeStopped: true}, + ClientOptions: ClientOptions{IncludeStopped: true}, } containers, err := client.ListContainers(filters.NoFilter) Expect(err).NotTo(HaveOccurred()) @@ -197,7 +198,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&mocks.Watchtower, &mocks.Running, &mocks.Restarting)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false, IncludeRestarting: true}, + ClientOptions: ClientOptions{IncludeRestarting: true}, } containers, err := client.ListContainers(filters.NoFilter) Expect(err).NotTo(HaveOccurred()) @@ -210,7 +211,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&mocks.Watchtower, &mocks.Running)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false, IncludeRestarting: false}, + ClientOptions: ClientOptions{IncludeRestarting: false}, } containers, err := client.ListContainers(filters.NoFilter) Expect(err).NotTo(HaveOccurred()) @@ -224,7 +225,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&consumerContainerRef)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false}, + ClientOptions: ClientOptions{}, } container, err := client.GetContainer(consumerContainerRef.ContainerID()) Expect(err).NotTo(HaveOccurred()) @@ -238,7 +239,7 @@ var _ = Describe("the client", func() { mockServer.AppendHandlers(mocks.GetContainerHandlers(&consumerContainerRef)...) client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false}, + ClientOptions: ClientOptions{}, } container, err := client.GetContainer(consumerContainerRef.ContainerID()) Expect(err).NotTo(HaveOccurred()) @@ -253,7 +254,7 @@ var _ = Describe("the client", func() { It("should include container id field", func() { client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false}, + ClientOptions: ClientOptions{}, } // Capture logrus output in buffer @@ -320,7 +321,7 @@ var _ = Describe("the client", func() { It(`should omit the container ID alias`, func() { client := dockerClient{ api: docker, - ClientOptions: ClientOptions{PullImages: false, IncludeRestarting: false}, + ClientOptions: ClientOptions{IncludeRestarting: false}, } container := MockContainer(WithImageName("docker.io/prefix/imagename:latest")) diff --git a/pkg/notifications/shoutrrr.go b/pkg/notifications/shoutrrr.go index de59d62..cc3a931 100644 --- a/pkg/notifications/shoutrrr.go +++ b/pkg/notifications/shoutrrr.go @@ -60,7 +60,7 @@ func (n *shoutrrrTypeNotifier) GetNames() []string { return names } -// GetNames returns a list of URLs for notification services that has been added +// GetURLs returns a list of URLs for notification services that has been added func (n *shoutrrrTypeNotifier) GetURLs() []string { return n.Urls } @@ -73,7 +73,7 @@ func (n *shoutrrrTypeNotifier) AddLogHook() { n.receiving = true log.AddHook(n) - // Do the sending in a separate goroutine so we don't block the main process. + // Do the sending in a separate goroutine, so we don't block the main process. go sendNotifications(n) } From 097df1100008836e34f3f4de99750d981d4159b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Sat, 11 Nov 2023 14:57:21 +0100 Subject: [PATCH 06/27] feat(docs): add linking and output messages (#1831) --- docs/template-preview.md | 56 ++++++++++++++++++++++------ pkg/notifications/preview/tplprev.go | 4 +- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/docs/template-preview.md b/docs/template-preview.md index 3ae4321..3d99ce9 100644 --- a/docs/template-preview.md +++ b/docs/template-preview.md @@ -40,7 +40,7 @@ } #tplprev button { border-radius: 0.1rem; - color: var(--md-typeset-color); + color: var(--md-primary-bg-color); background-color: var(--md-primary-fg-color); flex:1; min-width: 12ch; @@ -78,6 +78,8 @@ flex:1; width:100% } + #result b {color: var(--md-code-hl-special-color)} + #result i {color: var(--md-code-hl-keyword-color)} #tplprev .loading { position: absolute; inset: 0; @@ -90,12 +92,14 @@ -
+
loading wasm...
-