Commit Graph

99 Commits (1b405d4c771350d16f85b5bbbe9305f5a97834fd)

Author SHA1 Message Date
nils måsén 1b405d4c77
test: container client tests refactor (#1117) 3 years ago
nils måsén 2c8695683d test: reduce test output noise 3 years ago
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
3 years ago
nils måsén 47a640b764
update dependencies (sane go.mod) (#1061) 3 years ago
nils måsén 697397f289
feat(log): add context fields to lifecycle events (#1007) 3 years ago
nils måsén cd0ec88764
fix(notifications): default templates and logic (#1010)
* fix(notifications): default templates and logic
* fix multi-entry report notifs and add test
* add tests for log queueing
3 years ago
nils måsén fc31c6eb26
feat(shoutrrr): update to v0.5 (#1055)
* feat(shoutrrr): update to v0.5
* fix slack URL and tests
* add tests for slack icon override
* bump shoutrrr to v0.5.1
3 years ago
nils måsén 9bb8991a76
fix(digest): check container image info for nil (#1027) 3 years ago
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
3 years ago
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.
3 years ago
Amir Zarrinkafsh dc12a1ac7f
feat: allow hostname override for notifiers (#994)
* feat: allow hostname override for email notifier

As it currently stands all notifiers utilise `os.Hostname` to populate their titles/subjects.

When utilising Docker with a bridged network if you set the hostname for a container to an external DNS hostname Docker's internal DNS resolver will override said hostname for all containers within the bridged network.

This change allows a user to specify what hostname should be represented in the email notifications without having to change the `os.Hostname`.

* feat: allow custom hostname for all notifiers

* docs: adjust notification hostname flag
3 years ago
nils måsén f508c92ae0
* feat: custom user agent (#990)
* fix: move build meta to own package
  this allows it to be referenced from other packages without causing a cyclic dependency
* feat: custom user agent
3 years ago
nils måsén dec6f84a70
test: fix metrics api test stability (#930)
* use httptest instead of host port binding
* restore matrix and remove artificial delay
* fix metrics api test expect calls
3 years ago
DasSkelett 6b155a111a
Allow running periodic updates with enabled HTTP API (#916)
* Allow running periodic updates with enabled HTTP API

* Add --http-api-periodic-polls to docs
3 years ago
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
3 years ago
nils måsén fdf6e46e7b
fix: use default http transport for head (#926)
note: still disables TLS verification to enable use with local regisitries
3 years ago
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>
3 years ago
Simon Aronsson dff8378778
Feat/head failure toggle (#928)
* 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 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

* see if moving ubuntu out of the matrix solves test issue

Co-authored-by: nils måsén <nils@piksel.se>
3 years ago
nils måsén 6f281b727a
feat: update shoutrrr to v0.4.4 (#914) 3 years ago
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>
3 years ago
Simon Aronsson 028f19ac47
Move token logs to trace 3 years ago
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
3 years ago
nils måsén 4142f7966a
fix: move notify URL to trace log (#907) 3 years ago
nils måsén 6a9d985ce7
feat(log): use short image/container IDs in logs (#888) 3 years ago
nils måsén b644ec6829
fix(notifier): don't panic on unconfigured notifier (#869) 3 years ago
nils måsén 9fa2fd82a6
feat: include additional info in startup (#809) 3 years ago
nils måsén 738215a1f7
Update Shoutrrr to v0.4 (#810) 3 years ago
Zois Pagoulatos d04d71508f
fix: Disallow log level 'trace' (#765)
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
4 years ago
Zois Pagoulatos 4689853493
fix: Set log level to debug for message about API token (#757) 4 years ago
nils måsén 40ab6fd5ba
Fix notifications and old instance cleanup (#748)
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
4 years ago
Simon Aronsson d7d5b25882
Prometheus support (#450)
Co-authored-by: nils måsén <nils@piksel.se>
Co-authored-by: MihailITPlace <ya.halo-halo@yandex.ru>
Co-authored-by: Sebastiaan Tammer <sebastiaantammer@gmail.com>
4 years ago
Simon Aronsson 35490c853d
cherrypick notification changes from #450 (#745) 4 years ago
nils måsén 3bbe1bd109
fix manifest tag index in manifest.go (#731)
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
4 years ago
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.
4 years ago
Simon Aronsson 8b81fbd48d
Revert "feat(config): swap viper and cobra for config (#684)"
This reverts commit ff8cb884a0.
4 years ago
Simon Aronsson 89119515af
clean up scope builder and remove fmt print 4 years ago
Simon Aronsson cf6a71de81
fix linting issues 4 years ago
Simon Aronsson eb8580f7f2
make sure all different ref formats are supported 4 years ago
nils måsén ff8cb884a0
feat(config): swap viper and cobra for config (#684) 4 years ago
nils måsén cbe9ab87fa
move secret value "credentials" to trace log (#707) 4 years ago
Simon Aronsson ea16683c46
add defered closer calls for the http clients (#705) 4 years ago
rg9400 9ac1bf6ca2
fix typo (#702) 4 years ago
Simon Aronsson cb62b16369
add http head based digest comparison to avoid dockerhub rate limits 4 years ago
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>
4 years ago
nils måsén 64d48b70c2
fix: return nil imageinfo when retrieve fails (#680) 4 years ago
Simon Aronsson a7a28ec984
fix fmt and vetting issues 4 years ago
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
4 years ago
Ben Osheroff c56e0a95a7
Rolling restart (#619)
* implement rolling restart functionality

bouncing each image individually can ensure that a group of docker
containers launched with docker-compose can stay 100% up during deploy.

* move rolling restart into a function

* honor params.Cleanup

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
4 years ago
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
4 years ago
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
4 years ago