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 ¶
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.
const EnvInterval = "APP_IMAGE_UPDATE_INTERVAL"
EnvInterval overrides DefaultInterval (a Go duration such as "30m").
Variables ¶
This section is empty.
Functions ¶
func IntervalFromEnv ¶
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 HTTPTagLister ¶
HTTPTagLister reads /v2/<repo>/tags/list from an OCI registry, following Link pagination and the Bearer token challenge.
func (HTTPTagLister) ListTags ¶
func (l HTTPTagLister) ListTags(ctx context.Context, ref string, auth *docker.RegistryAuth) ([]string, error)
ListTags implements TagLister.
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Range is a set of comparators that must all hold, parsed from a spec such as "1.x", "1.2.x", "^1.2.3", "~1.2.3" or ">=1.2.0 <2.0.0".
func ParseRange ¶
ParseRange validates spec. An empty spec or "*" matches every version.
type Scheduler ¶
Scheduler checks every opted-in app once per Tick.
type Store ¶
type Store interface {
ListEnabledImageAutoUpdates(ctx context.Context) ([]store.ImageAutoUpdate, error)
}
Store lists the apps that opted in.
type TagLister ¶
type TagLister interface {
ListTags(ctx context.Context, ref string, auth *docker.RegistryAuth) ([]string, error)
}
TagLister lists every tag of an image repository; ref is any reference of that repository (its tag is ignored).