imagewatch

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package imagewatch polls container registries for new image digests and drives the per-tile update policy (notify / auto-redeploy).

Index

Constants

View Source
const (
	SettingInterval = "image_check_interval"
)

Settings keys: check cadence in minutes ("" = 5, "0" = watcher off) and the RFC3339 stamp of the last sweep (the janitor ticks every minute; this is what makes the cadence runtime-changeable).

Variables

This section is empty.

Functions

func ParseRef

func ParseRef(ref string) (host, repoPath, tag string, ok bool)

ParseRef splits an image reference into its registry host, repository path and tag. Digest-pinned refs (name@sha256:...) return ok=false, there is nothing to watch.

func WatchRef

func WatchRef(tileID string) string

WatchRef is the cron_runs namespace for a tile's registry checks.

Types

type Client

type Client struct {
	HTTP *http.Client
}

Client asks registries for manifest digests. Zero value is usable.

func (*Client) Digest

func (c *Client) Digest(ctx context.Context, ref, user, pass string) (string, error)

Digest returns the registry's current manifest digest for ref, via a HEAD that doesn't count toward Docker Hub pull limits. user/pass may be empty (public images); they also authenticate token requests for private ones.

type Watcher

type Watcher struct {
	Store    repo.Store
	Notifier *notify.Notifier
	Engine   *deploy.Engine
	DB       *managedtiles.Service
	Cluster  *cluster.Cluster
	GH       *githubapp.Client
	Client   *Client
	// contains filtered or unexported fields
}

Watcher is the janitor task that polls registries for tiles whose update_policy asks for it, records new digests and applies the policy.

func (*Watcher) Name

func (w *Watcher) Name() string

func (*Watcher) Run

func (w *Watcher) Run(ctx context.Context) (int64, error)

Run is one janitor tick: skip until the configured interval has passed, then check every watchable tile, deduping registry calls by image ref.

Jump to

Keyboard shortcuts

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