mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
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
This commit is contained in:
parent
d0ecc23d72
commit
e3dd8d688a
32 changed files with 853 additions and 598 deletions
13
cmd/root.go
13
cmd/root.go
|
|
@ -34,7 +34,7 @@ var (
|
|||
noRestart bool
|
||||
monitorOnly bool
|
||||
enableLabel bool
|
||||
notifier *notifications.Notifier
|
||||
notifier t.Notifier
|
||||
timeout time.Duration
|
||||
lifecycleHooks bool
|
||||
rollingRestart bool
|
||||
|
|
@ -268,9 +268,9 @@ func writeStartupMessage(c *cobra.Command, sched time.Time, filtering string) {
|
|||
}
|
||||
|
||||
notifs := "Using no notifications"
|
||||
notifList := notifier.String()
|
||||
if len(notifList) > 0 {
|
||||
notifs = "Using notifications: " + notifList
|
||||
notifierNames := notifier.GetNames()
|
||||
if len(notifierNames) > 0 {
|
||||
notifs = "Using notifications: " + strings.Join(notifierNames, ", ")
|
||||
}
|
||||
|
||||
log.Info("Watchtower ", meta.Version, "\n", notifs, "\n", filtering, "\n", schedMessage)
|
||||
|
|
@ -338,11 +338,12 @@ func runUpdatesWithNotifications(filter t.Filter) *metrics.Metric {
|
|||
LifecycleHooks: lifecycleHooks,
|
||||
RollingRestart: rollingRestart,
|
||||
}
|
||||
metricResults, err := actions.Update(client, updateParams)
|
||||
result, err := actions.Update(client, updateParams)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
notifier.SendNotification()
|
||||
notifier.SendNotification(result)
|
||||
metricResults := metrics.NewMetric(result)
|
||||
log.Debugf("Session done: %v scanned, %v updated, %v failed",
|
||||
metricResults.Scanned, metricResults.Updated, metricResults.Failed)
|
||||
return metricResults
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue