owned

package
v0.14.0 Latest Latest
Warning

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

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

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

Constants

This section is empty.

Variables

View Source
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 IsOwned

func IsOwned(rt *v1.Route) bool

IsOwned reports whether a Site or a Function controls rt (ADR-0241 Decision 6).

func MapOwner

func MapOwner(st store.Store, kind v1.Kind) controller.MapFunc

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.

func Remove

func Remove(ctx context.Context, st store.Store, owner v1.Object, name v1.ObjectName) error

Remove deletes the owner's Route name when the owner controls it; an absent or foreign Route is left as it is.

Types

This section is empty.

Jump to

Keyboard shortcuts

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