beacon

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package beacon discovers artifacts and emits Bundles.

Index

Constants

View Source
const DefaultInterval = 5 * time.Minute

DefaultInterval is used when a Beacon does not set one.

View Source
const DefaultRetain int32 = 10

DefaultRetain is how many unreferenced Bundles survive when a Beacon does not say. Enough to roll back a few releases by hand; not enough to fill etcd.

View Source
const LabelBeacon = "hecate.dev/beacon"

LabelBeacon associates a Bundle with the Beacon that emitted it.

Deliberately a label rather than an owner reference: an owner reference would cascade-delete every Bundle when a Beacon is removed, destroying the record of what is running in production. For a tool whose product is the audit trail that is the wrong default. Cleanup is the garbage collector's job, under the safety rule in D13.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrNoMatch

type ErrNoMatch struct{ Reason string }

ErrNoMatch reports that nothing survived filtering and selection. It is a normal outcome, not a failure: a watch with a constraint no published tag satisfies is correctly configured and simply has nothing to offer yet.

func (*ErrNoMatch) Error

func (e *ErrNoMatch) Error() string

type ErrUnsupported

type ErrUnsupported struct{ What string }

ErrUnsupported reports a watch kind or option that is declared in the API but not implemented. Distinct from a failure: the configuration is valid, we just cannot honour it yet, and saying so beats resolving something plausible and wrong.

func (*ErrUnsupported) Error

func (e *ErrUnsupported) Error() string

type Reconciler

type Reconciler struct {
	client.Client
	Resolver *Resolver
	Recorder events.EventRecorder
	// Now is the clock, injectable for tests.
	Now func() time.Time
}

Reconciler polls a Beacon's watched sources and emits Bundles.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile polls one Beacon.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the controller.

type Resolver

type Resolver struct {
	// Client reads credential Secrets. May be nil for public sources only.
	Client client.Client
}

Resolver turns a WatchSource into the concrete Artifact currently at its head.

One struct rather than an interface with a registry: there are three watch kinds, they are enumerated in the API, and nothing outside this package implements one. An abstraction here would be indirection with no second implementation to justify it.

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, namespace string, w v1alpha1.WatchSource) (v1alpha1.Artifact, error)

Resolve returns the Artifact a WatchSource currently points at.

type Selection

type Selection struct {
	Strategy   v1alpha1.TagSelection
	Constraint string
	Allow      string
	Ignore     []string
}

Selection is the "which tag do we want" half of a watch, shared by ImageWatch and TagWatch because both express it identically.

func (Selection) Pick

func (s Selection) Pick(tags []string) (string, error)

Pick returns the tag this Selection resolves to.

Jump to

Keyboard shortcuts

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