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 ¶
- func AuditUnmanaged(client container.Client, scope string, logWarnings bool) error
- func CheckForMultipleWatchtowerInstances(client container.Client, cleanup bool, scope string) error
- func CheckForSanity(client container.Client, filter types.Filter, rollingRestarts bool) error
- func EvaluateImageCooldownForTest(containerName string, newest types.ImageID, cooldown time.Duration) (bool, time.Duration)
- func ResetAuditStateForTest()
- func ResetCooldownStateForTest()
- func RewindCooldownFirstSeenForTest(containerName string, by time.Duration)
- func Update(client container.Client, params types.UpdateParams) (types.Report, error)
- func UpdateImplicitRestart(containers []types.Container)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditUnmanaged ¶ added in v1.9.0
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 ¶
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 ¶
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
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 ¶
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 ¶
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.