Documentation
¶
Overview ¶
Package beacon discovers artifacts and emits Bundles.
Index ¶
Constants ¶
const DefaultInterval = 5 * time.Minute
DefaultInterval is used when a Beacon does not set one.
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.
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) 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.