Commit Graph

62 Commits

Author SHA1 Message Date
nils måsén 48539c4faf fix: set nopull param from args (#1830) 2023-11-11 14:50:43 +01:00
nils måsén c4d493881d fix: handle missing healthcheck keys in config (#1810) 2023-10-23 10:31:07 +02:00
nils måsén 40b8c77100 fix: use new healthcheck config if not overridden (#1801) 2023-10-21 20:57:33 +02:00
donuts-are-good 72e437f173 chore: replace usages of ioutil (#1792) 2023-10-14 10:57:22 +02:00
nils måsén 897b1714d0 fix: only remove container id network aliases (#1724) 2023-09-16 17:16:08 +02:00
jebabin 650acde015 feat: add a label take precedence argument (#1754)
Co-authored-by: nils måsén <nils@piksel.se>
2023-09-16 17:13:41 +02:00
schizo99 dca45f50cb feat: support container network mode (#1429)
Co-authored-by: nils måsén <nils@piksel.se>
Co-authored-by: Andreas Åhman <andreas.ahman@ingka.ikea.com>
2023-08-08 18:32:44 +02:00
Simon Aronsson bba9b2b100 fix: empty out the aliases on recreation (#1699)
* fix: empty out the aliases on recreation

* test alias purging
2023-07-28 15:20:22 +02:00
nils måsén 0a5bd54fb7 feat(clean): log removed/untagged images (#1466) 2023-04-15 12:56:51 +02:00
nils måsén dd1ec09668 fix: always use container interface (#1516) 2023-04-12 17:36:01 +02:00
dependabot[bot] df1b86bc29 chore(deps): bump docker/docker from 20.10.23+inc to 23.0.2+inc (#1612)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: nils måsén <nils@piksel.se>
2023-04-10 13:22:06 +02:00
nils måsén 9470bf81c5 fix: always add missing slashes to link names (#1588) 2023-03-12 10:57:55 +01:00
Gilbert Gilb's bbbe04119c feat: add no-pull label for containers (#1574)
Co-authored-by: Nedžad Alibegović <nedzad@nedzad.dev>
Co-authored-by: nils måsén <nils@piksel.se>
2023-03-12 10:07:24 +01:00
nothub 3190ce2df1 feat: ignore removal error due to non-existing containers (#1481)
Co-authored-by: nils måsén <nils@piksel.se>
Fixes https://github.com/containrrr/watchtower/issues/1480
2022-12-06 17:40:26 +01:00
nils måsén a4d00bfd75 test: refactor/simplify container mock builders (#1495) 2022-12-06 16:28:20 +01:00
nils måsén cb555f539d preparations for soft deprecation of legacy notification args (#1377)
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2022-11-01 00:00:00 +01:00
Jauder Ho e04a107694 chore(deps): update go version to 1.18 (#1363)
Co-authored-by: nils måsén <nils@piksel.se>
2022-09-04 13:56:29 +02:00
dependabot[bot] 063e7247b9 chore(deps): bump github.com/onsi/gomega from 1.10.3 to 1.20.0 (#1360)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: nils måsén <nils@piksel.se>
2022-08-24 09:03:06 +02:00
Dirk Kok 739f328ee5 feat(http): optional query parameter to update only containers of a specified image (#1289)
* feat(http): optional query parameter to update only containers of a specified image

* fix style issues

* comma separated image parameter

* Support comma-separated query parameter as well as specifying it multiple times

Co-authored-by: nils måsén <nils@piksel.se>

* fixed compile error

* fixed FilterByImageTag

Not sure what changed in my testing setup, but Docker reports image names including the tag name now.

* consistent use of image/tag (use image)

* fixed multiple image queries

* assuming I'm right here, only block on lock when any images are specified.

* add unit tests for image filter. didn't add tests for update api because they didn't already exist

* whoops.

* use ImageName instead, add unit test for empty ImageName filter.

Co-authored-by: nils måsén <nils@piksel.se>
2022-06-14 09:13:14 +02:00
nils måsén e983beb52a fix: gracefully skip pinned images (#1277)
* move client args to opts struct
* gracefully skip pinned images
* replace newClientNoAPI with literals
2022-05-27 12:16:18 +02:00
nils måsén 04db93c770 fix: add missing portmap when needed (#1183) 2022-01-22 17:40:37 +01:00
Patrice b4a225c8bb Post update time out (#1124)
* adding post update timeout option

* removing extra word
2021-11-18 14:54:35 +01:00
Jeremy L. Morris d9d6f794a1 feat: use a more specific error type for no container info (#1115)
Co-authored-by: Jeremy L. Morris <jmorris@digitalocean.com>
2021-11-12 12:21:34 +01:00
nils måsén 0060cd6ee4 test: fully reset ghttp server (#1121) 2021-11-02 16:53:56 +01:00
nils måsén 1b405d4c77 test: container client tests refactor (#1117) 2021-11-01 20:35:50 +01:00
nils måsén 26fba69169 test: refactor client tests
should not be explicitly telling what they are testing and the requirements
fixed the test data so that it doesn't contain discrepancies
fully reset the mock client (no shared state) and only support the calls that is expected
2021-11-01 19:26:41 +01:00
nils måsén 47a640b764 update dependencies (sane go.mod) (#1061) 2021-09-29 11:34:05 +02:00
nils måsén 697397f289 feat(log): add context fields to lifecycle events (#1007) 2021-09-19 18:07:32 +02:00
nils måsén e3dd8d688a Session report collection and report templates (#981)
* wip: notification stats

* make report notifications optional

* linting/documentation fixes

* linting/documentation fixes

* merge types.Container and container.Interface

* smaller naming/format fixes

* use typed image/container IDs

* simplify notifier and update tests

* add missed doc comments

* lint fixes

* remove unused constructors

* rename old/new current/latest
2021-06-27 09:05:01 +02:00
yrien30 145fe6dbcb Pre-update lifecycle hook (#793)
* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code
#649

* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code
#649

* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code
#649

* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code
#649

* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649

* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649

* Make watchtower skip update if pre-update lifecycle hook exits with a non-zero exit code #649

* Prevent starting new container if old one is not stopped because of lifecycle hook.

* Add null check for c.containerInfo.State in IsRunning

* Fixed that the container would not start

* Added test for preupdate

* EX_TEMPFAIL -> ExTempFail

* Added missing fuction ouput names

* Skip preupdate when container is restarting.
2021-06-24 00:36:33 +02:00
nils måsén 12467712a1 feat: check container config before update (#925)
* feat: check container config before restart
* fix: only skip when hostconfig and config differ
* fix: update test mocks to not fail tests
* test: add verify config tests
2021-04-24 18:29:05 +02:00
nils måsén d38e52b5c6 fix: merge artifacts and broken shoutrrr tests (#929)
* test: add missing container test suite
* fix broken tests
* fix: remove duplicate merge artifact

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2021-04-24 15:42:31 +02:00
nils måsén b4cf17d33f feat: make head pull failure warning toggleable (#912)
* feat: make head pull failure warning toggleable

* expect prometheus tests to go through EVENTUALLY

* wait for queue to be empty before checking test conditions

* clean up new head failure toggle

* fixup! clean up new head failure toggle

* test: add registry tests

* test: add warn on head failure tests

* fix client interface and make tests hit more lines

* make all tests use NewClient instead of creating a struct pointer

* fix lint issues

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2021-04-23 16:34:21 +02:00
Simon Aronsson 3de202a965 fix depends on behavior and simplify some of its logic (#908)
* fix depends on behavior and simplify some of its logic

* fix comments
2021-04-18 18:37:35 +02:00
nils måsén 6a9d985ce7 feat(log): use short image/container IDs in logs (#888) 2021-04-18 18:34:38 +02:00
Turtle Kalus 5983d58d7c Log based on registry known-support - reduce noise on notifications (#716)
Log based on registry known-poor support of HEAD in checking container
manifest.

Some private registries do not support HEAD (E.G. GitLab Container Registry).
With the current config, this log message is causing a notification to be
sent for each container hosted in a registry lacking HEAD support.

log.Debug or log.Warning for failed HTTP HEAD-check based on registry hostname
where HEAD-check is known to fail.

For Docker Hub, a failed HEAD leading to a "regular pull" may count against a
user's call-quota whereas other registry implementations do not support HEAD,
or whose container manifest may be in a different location.
2020-12-23 00:48:38 +01:00
Simon Aronsson 8b81fbd48d Revert "feat(config): swap viper and cobra for config (#684)"
This reverts commit ff8cb884a0.
2020-12-21 23:08:23 +01:00
nils måsén ff8cb884a0 feat(config): swap viper and cobra for config (#684) 2020-12-21 15:17:45 +01:00
rg9400 9ac1bf6ca2 fix typo (#702) 2020-12-08 18:40:27 +01:00
Simon Aronsson cb62b16369 add http head based digest comparison to avoid dockerhub rate limits 2020-12-06 13:21:04 +01:00
yrien30 2842b97df3 Allow watchtower to update rebooting containers (#651)
Co-authored-by: nils måsén <nils@piksel.se>
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2020-11-19 19:03:17 +01:00
nils måsén 64d48b70c2 fix: return nil imageinfo when retrieve fails (#680) 2020-11-13 21:19:08 +01:00
Simon Aronsson a7a28ec984 fix fmt and vetting issues 2020-10-03 22:25:17 +02:00
David H bde421be0d Monitor-only for individual containers (#652)
* Add monitor-only label

* Add tests for monitor-only

* Treat missing monitor-only label as if the option was set to false

* Add docs for container-based monitor-only

* Add function doc

* Fix monitor-only logic
2020-10-03 22:00:02 +02:00
Victor Moura 6a18ee911e Adds scopeUID config to enable multiple instances of Watchtower (#511)
* Adds scopeUID config to enable multiple instances of Watchtower

* Adds tests for multiple instance support with scopeuid

* Adds docs on scope monitoring and multiple instance support

* Adds multiple instances docs to mkdocs config file

* Changes multiple instances check and refactors naming for scope feature

* Applies linter suggestions

* Fixes documentation on Watchtower monitoring scope
2020-08-21 20:13:47 +02:00
nils måsén 5efb249a86 Skip updating containers where no local image info can be retrieved (#612)
* Revert "Image of running container no longer needed locally (#571)"

This reverts commit 6da66fb312.

* Update client.go

* fix: skip updating when no image info can be retrieved

This will allow watchtower to continue even though the image info for a
container cannot be retrieved. If this happens one warning will be emitted
and the container will be skipped, unless NoRestart or OnlyMonitor is supplied
2020-08-18 20:55:35 +02:00
Sebastiaan Tammer 6da66fb312 Image of running container no longer needed locally (#571) 2020-06-10 11:34:30 +02:00
Valentine Zavadsky b32cb5d35d Add ability to overrider depending containers with special label (#489)
* Add ability to overrider depending containers with special label

* Add documentation of how to override container dependencies with special label
2020-04-24 13:41:04 +02:00
Simon Aronsson 98c60d7441 fix some errors and clean up 2020-03-28 19:48:04 +01:00
Simon Aronsson 1d1c630f7a feat: add timeout override for pre-update lifecycle hook 2020-03-28 19:33:02 +01:00