actions

package
v1.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package actions orchestrates the high-level watchtower update flow: listing containers, running sanity and duplicate-instance checks, and driving the stop/start sequence through pkg/container.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditUnmanaged added in v1.9.0

func AuditUnmanaged(client container.Client, scope string, logWarnings bool) error

AuditUnmanaged classifies every container visible to the daemon into managed / excluded / unmanaged buckets, publishes those counts to Prometheus so the Grafana dashboard can show them, and — when logWarnings is true — logs change-detected warnings the first time each unmanaged container is seen. Steady state is silent: subsequent polls with the same set emit nothing unless the set changes (a new unlabeled container appears, or a previously-unlabeled one gets labeled or removed).

Metrics publication is unconditional — Prometheus gauges are always-on observability. The logWarnings flag gates only the `docker logs` output, typically wired to --audit-unmanaged.

func CheckForMultipleWatchtowerInstances

func CheckForMultipleWatchtowerInstances(client container.Client, cleanup bool, scope string) error

CheckForMultipleWatchtowerInstances will ensure that there are not multiple instances of the watchtower running simultaneously. If multiple watchtower containers are detected, this function will stop and remove all but the most recently started container. This behaviour can be bypassed if a scope UID is defined.

func CheckForSanity

func CheckForSanity(client container.Client, filter types.Filter, rollingRestarts bool) error

CheckForSanity makes sure everything is sane before starting

func EvaluateImageCooldownForTest added in v1.12.0

func EvaluateImageCooldownForTest(containerName string, newest types.ImageID, cooldown time.Duration) (bool, time.Duration)

EvaluateImageCooldownForTest exposes the cooldown decision function for external tests. Not for production use.

func ResetAuditStateForTest added in v1.11.0

func ResetAuditStateForTest()

ResetAuditStateForTest clears the in-memory audit cache. Intended for use between test specs — callers in production code have no reason to invoke it.

func ResetCooldownStateForTest added in v1.12.0

func ResetCooldownStateForTest()

ResetCooldownStateForTest clears the in-memory cooldown map. External test-only helper.

func RewindCooldownFirstSeenForTest added in v1.12.0

func RewindCooldownFirstSeenForTest(containerName string, by time.Duration)

RewindCooldownFirstSeenForTest shifts a container's recorded firstSeen backwards by the given amount, simulating the passage of wall-clock time without making tests sleep.

func Update

func Update(client container.Client, params types.UpdateParams) (types.Report, error)

Update looks at the running Docker containers to see if any of the images used to start those containers have been updated. If a change is detected in any of the images, the associated containers are stopped and restarted with the new image.

func UpdateImplicitRestart

func UpdateImplicitRestart(containers []types.Container)

UpdateImplicitRestart iterates through the passed containers, setting the `LinkedToRestarting` flag if any of it's linked containers are marked for restart

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL