Documentation
¶
Overview ¶
Package owned writes the Route a Site or a Function owns for its own edge address (ADR-0241 Decision 5): the owner is stamped as its controller, a Route of that name another object controls is left untouched, and Route events map back to the owner by controller and by name.
Index ¶
- Variables
- func Ensure(ctx context.Context, st store.Store, owner v1.Object, name v1.ObjectName, ...) (*v1.Route, error)
- func FunctionRouteName(fn v1.ObjectName) v1.ObjectName
- func IsOwned(rt *v1.Route) bool
- func MapOwner(st store.Store, kind v1.Kind) controller.MapFunc
- func Remove(ctx context.Context, st store.Store, owner v1.Object, name v1.ObjectName) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotOwned = errors.New("route: not controlled by this owner")
ErrNotOwned is a Route of the owner's Route name that this owner, with its current UID, does not control.
Functions ¶
func Ensure ¶
func Ensure(ctx context.Context, st store.Store, owner v1.Object, name v1.ObjectName, spec v1.RouteSpec) (*v1.Route, error)
Ensure creates the owner's Route name with spec, or updates the one the owner controls when its spec or group drifted. A Route of that name the owner does not control with its current UID is ErrNotOwned.
func FunctionRouteName ¶
func FunctionRouteName(fn v1.ObjectName) v1.ObjectName
FunctionRouteName is the Route a Function owns: fn-<name> while that fits a label, else cut to fit with the first hex digits of the name's SHA-256, as revisionName does.
func MapOwner ¶
MapOwner maps a Route event to the owners of kind (Site or Function) it may concern: its controller, and the owner whose Route name it carries, so a foreign Route's deletion re-runs a stuck owner. A shortened Function Route name is matched through a List of the namespace's Functions.
Types ¶
This section is empty.