imageupdate

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package imageupdate periodically asks the control plane to check each opted-in app's image tag against its registry and redeploy when it moved.

Index

Constants

View Source
const DefaultInterval = time.Hour

DefaultInterval is how often opted-in apps are checked. Hourly: registries rate-limit anonymous digest lookups, and a tag rarely moves faster.

View Source
const EnvInterval = "APP_IMAGE_UPDATE_INTERVAL"

EnvInterval overrides DefaultInterval (a Go duration such as "30m").

Variables

This section is empty.

Functions

func IntervalFromEnv

func IntervalFromEnv(logger *slog.Logger) time.Duration

IntervalFromEnv returns EnvInterval as a duration, else DefaultInterval.

Types

type Checker

type Checker interface {
	CheckImageUpdate(ctx context.Context, serviceName string) (string, error)
}

Checker runs one app's update check; *api.Router satisfies it.

type Scheduler

type Scheduler struct {
	Store   Store
	Checker Checker
	Logger  *slog.Logger
}

Scheduler checks every opted-in app once per Tick.

func (*Scheduler) Run

func (s *Scheduler) Run(ctx context.Context, interval time.Duration) error

Run ticks on interval until ctx is done.

func (*Scheduler) Tick

func (s *Scheduler) Tick(ctx context.Context) error

Tick checks each opted-in app; one app's failure never stops the rest.

type Store

type Store interface {
	ListEnabledImageAutoUpdates(ctx context.Context) ([]store.ImageAutoUpdate, error)
}

Store lists the apps that opted in.

Jump to

Keyboard shortcuts

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