Commit Graph

118 Commits

Author SHA1 Message Date
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
nils måsén 7900471f88 feat: add porcelain output (#1337)
* feat: add porcaline output

* feat(du-cli): add create-stale action

add create-stale action

Signed-off-by: nils måsén

* test(flags): add alias tests

* fix stray format string ref

* fix shell liniting problems

* feat(du-cli): remove created images

* add test for common template

* fix interval/schedule logic

* use porcelain arg as template version

* fix editor save artifacts

* use simpler v1 template

Signed-off-by: nils måsén
2022-08-14 10:11:31 +02:00
Mateusz Drab a429c373ff feat: regex container name filtering (#1241)
* Allow container name regex filtering

* make regex names backwards compatible

Co-authored-by: Mateusz Drab <mateuszd@mpd.pw>
Co-authored-by: nils måsén <nils@piksel.se>
2022-08-14 10:08:45 +02:00
Brian Choromanski 489356aa42 fix(notifications): include icon in slack legacy url (#1303) 2022-08-01 18:40:12 +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 2f4d58776d fix(notifications): title customization (#1219) 2022-04-18 19:37:13 +02:00
lazou a5c60a9fe6 feat(notifications): add general notification delay (#1246) 2022-03-09 11:03:06 +01:00
nils måsén be33c64afd fix: move invalid token to log field (#1171)
* fix: move invalid token to log field

* escape invalid token in log field

* Update pkg/api/api.go

Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2022-01-22 17:50:04 +01:00
nils måsén 04db93c770 fix: add missing portmap when needed (#1183) 2022-01-22 17:40:37 +01:00
nils måsén aa02d8d31b feat(notifications): add title field to template data (#1125) 2022-01-05 12:08:47 +01:00
nils måsén 1d59fb83dd feat(notifications): support delayed sending (#1142) 2022-01-05 09:31:01 +01:00
Juho-Pekka Kuitunen e14cc292ed feat: improve HTTP API logging, honor no-startup-message (#1091)
Co-authored-by: nils måsén <nils@piksel.se>
2021-11-29 15:07:26 +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
nils måsén 782529ddbd feat: improve session result logging (#1123)
- logs the session result as an info level message without notification instead of debug
- does not log that no notification was sent if there are no notifications enabled
2021-11-18 14:08:38 +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
Igor Zibarev 81036b078b fix(api): return appropriate status for unauthorized requests (#1116) 2021-11-12 12:16:24 +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 2c8695683d test: reduce test output noise 2021-11-01 19:36:38 +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 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
2021-09-19 18:06:14 +02:00
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
2021-09-19 18:05:10 +02:00
nils måsén 9bb8991a76 fix(digest): check container image info for nil (#1027) 2021-07-25 12:44:29 +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
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
2021-06-24 00:29:20 +02:00
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
2021-06-11 19:23:00 +02:00
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
2021-05-25 16:42:11 +02:00
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
2021-04-27 22:18:45 +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 fdf6e46e7b fix: use default http transport for head (#926)
note: still disables TLS verification to enable use with local regisitries
2021-04-24 18:25: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
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>
2021-04-24 13:14:52 +02:00
nils måsén 6f281b727a feat: update shoutrrr to v0.4.4 (#914) 2021-04-23 16:36:09 +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 028f19ac47 Move token logs to trace 2021-04-21 10:03:05 +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 4142f7966a fix: move notify URL to trace log (#907) 2021-04-18 18:35:15 +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
nils måsén b644ec6829 fix(notifier): don't panic on unconfigured notifier (#869) 2021-04-18 18:11:46 +02:00
nils måsén 9fa2fd82a6 feat: include additional info in startup (#809) 2021-03-28 21:04:11 +02:00
nils måsén 738215a1f7 Update Shoutrrr to v0.4 (#810) 2021-03-13 08:58:11 +01:00
Zois Pagoulatos d04d71508f fix: Disallow log level 'trace' (#765)
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2021-01-12 20:19:14 +01:00
Zois Pagoulatos 4689853493 fix: Set log level to debug for message about API token (#757) 2021-01-12 08:34:11 +01:00
nils måsén 40ab6fd5ba Fix notifications and old instance cleanup (#748)
Co-authored-by: Simon Aronsson <simme@arcticbit.se>
2021-01-10 11:12:54 +01:00
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>
2021-01-06 22:28:32 +01:00