registry

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package registry owns the Registry — the runtime lookup table that wires Domains and strategies into the Engine. The Registry is populated once at manager startup and then read concurrently by the Engine during reconciliation. All methods are safe for concurrent use.

Two registries are maintained in a single struct:

  • Domain registry: maps GVK → Domain. The Engine uses this to route every Command to the correct handler. One Domain per GVK — duplicate registration silently overwrites, so startup order matters.

  • Strategy registry: maps name → implementation (any). Used for pluggable build strategies (e.g. "buildpacks-v3", "dockerfile"). Typed retrieval is the caller's responsibility via a type assertion after GetStrategy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is the runtime lookup table for Domains and strategies. Populated at manager startup; read concurrently by the Engine thereafter. All methods acquire the appropriate lock — callers need no external synchronisation.

func NewRegistry

func NewRegistry() *Registry

NewRegistry constructs an empty Registry ready for domain and strategy registration. Called once during manager setup before any controllers start.

func (*Registry) GetDomain

func (r *Registry) GetDomain(gvk schema.GroupVersionKind) (domain.Domain, bool)

GetDomain retrieves the Domain registered for gvk. Returns false if no Domain is registered — the Engine surfaces this as an error to the caller.

func (*Registry) GetStrategy

func (r *Registry) GetStrategy(name string) (any, bool)

GetStrategy retrieves a strategy by name. The caller is responsible for type-asserting the returned value to the concrete strategy interface. Returns false if no strategy is registered under name.

func (*Registry) ListDomains

func (r *Registry) ListDomains() []schema.GroupVersionKind

ListDomains returns the GVKs of all registered Domains. Order is non-deterministic (map iteration). Intended for startup logging and diagnostics only — not for routing decisions.

func (*Registry) ListStrategies

func (r *Registry) ListStrategies() []string

ListStrategies returns the names of all registered strategies. Order is non-deterministic (map iteration). Intended for startup logging and diagnostics only.

func (*Registry) RegisterDomain

func (r *Registry) RegisterDomain(gvk schema.GroupVersionKind, d domain.Domain)

RegisterDomain registers a Domain for the given GVK. Called at startup for each CR kind the platform manages. Duplicate registration overwrites the previous entry — registration order is the caller's responsibility.

func (*Registry) RegisterStrategy

func (r *Registry) RegisterStrategy(name string, v any)

RegisterStrategy registers a named strategy implementation. The name is the lookup key used at reconciliation time (e.g. "buildpacks-v3", "dockerfile"). Duplicate names overwrite silently.

Jump to

Keyboard shortcuts

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