Documentation
¶
Overview ¶
Package ownedstore writes the stores a resource declares under ADR-0178's marker rule, for any owner kind (ADR-0248 Decision 3): a store an owner makes carries the owner's non-controller marker, plus a cascading controller reference under deletion: delete, and an existing store without this owner's current-UID marker is refused, never taken over.
Index ¶
- Constants
- Variables
- func Ensure(ctx context.Context, st store.Store, owner, desired v1.Object, ...) (v1.UID, error)
- func IsMarker(r v1.OwnerReference) bool
- func MapOwner(_ store.Store, kind v1.Kind) controller.MapFunc
- func Marked(refs []v1.OwnerReference, owner v1.Object) bool
- func Refs(owner v1.Object, deletion v1.DeletionPolicy) []v1.OwnerReference
- type SecretGap
Constants ¶
const ( ReasonSecretNotFound = "SecretNotFound" ReasonSecretKeyMissing = "SecretKeyMissing" )
The reasons a declared Secret stops its declarer (ADR-0213 Decision 8).
Variables ¶
var ErrNotOwned = errors.New("ownedstore: the store exists and is not this owner's")
ErrNotOwned is a store that exists without this owner's current-UID marker.
Functions ¶
func Ensure ¶
func Ensure(ctx context.Context, st store.Store, owner, desired v1.Object, deletion v1.DeletionPolicy) (v1.UID, error)
Ensure creates desired with owner's references, or updates the store of that name that carries owner's marker with desired's spec, references and resource group when one differs, keeping its status, and returns the store's UID. A store without the marker is ErrNotOwned and is not written.
func IsMarker ¶
func IsMarker(r v1.OwnerReference) bool
IsMarker reports whether r has the shape of a store marker: a non-controller reference naming a kind that stamps one, a Workflow (ADR-0178), an App (ADR-0199 Decision 8), a Function or Site (ADR-0248), or a CatalogService (ADR-0251).
func MapOwner ¶
MapOwner maps a store event to the owners of kind whose marker the store carries, so a change to a store re-runs the reconciler of the resource that declares it.
func Marked ¶
func Marked(refs []v1.OwnerReference, owner v1.Object) bool
Marked reports whether refs hold owner's marker: its kind, name and current UID. A marker never moves to another UID (ADR-0178 Decision 4).
func Refs ¶
func Refs(owner v1.Object, deletion v1.DeletionPolicy) []v1.OwnerReference
Refs are the references a store owner stamps: its marker and, under deletion: delete, its cascading controller reference.
Types ¶
type SecretGap ¶
type SecretGap struct {
Index int
Name v1.ObjectName
Key string
}
SecretGap is the first declared Secret that is not complete: the declaration's index and name, and the first declared key it lacks, or no key when the Secret does not exist. It holds no Secret value.
func CheckSecrets ¶
func CheckSecrets(ctx context.Context, st store.Store, ns v1.NamespaceName, decls []v1.SecretDeclaration) (*SecretGap, error)
CheckSecrets gets each Secret decls declares in ns, in declaration order, and returns the first gap, nil when every one exists with every declared key (ADR-0213 Decision 8). It tests key membership only and only reads.