Documentation
¶
Overview ¶
pkg/motif/expander.go
Expander instantiates a Motif by binding its inputs and expanding its resource blocks into a concrete HookTemplates value.
Two modes:
Static (ork doctor init): inputs resolved from explicit with: bindings at generation time. The expanded resources are inlined into the generated Katalog. No runtime dependency on the Motif.
Dynamic (Katalog runtime): inputs resolved at Katalog startup, before any reconcile. The Motif is loaded once and its templates compiled with the input bindings.
pkg/motif/loader.go
Loads a Motif from a file path or registry reference. Resolution follows the same semantics as RegistrySource in a Komposer — if you know how to pull a pattern, you already know how to pull a Motif.
The Orkestra registry houses both patterns and motifs. Each Motif is a standalone OCI artifact or Git repo with motif.yaml at its root.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load loads a Motif from a local file path. For full import resolution (registry, OCI, auth), use LoadImport.
func LoadImport ¶
func LoadImport(imp *orktypes.MotifImport) (*orktypes.Motif, error)
LoadImport resolves and loads a Motif from a MotifImport declaration. Supports file paths, OCI artifacts, and Git registries — the same resolution semantics as RegistrySource in a Komposer.
File path (developer path):
imp.Motif = "./postgres/motif.yaml"
OCI artifact — motif.yaml at artifact root:
imp.Motif = "ghcr.io/orkspace/orkestra-registry/postgres@v16" imp.OCI = true
Git registry — motif.yaml at repo root (standalone Motif repo):
imp.Motif = "https://github.com/myorg/postgres-motif@main"
Pattern with bundled Motif (pattern includes both katalog.yaml and motif.yaml):
imp.Motif = "ghcr.io/orkspace/orkestra-registry/postgres@v16" imp.OCI = true
func MergeHookTemplates ¶
func MergeHookTemplates(dst, src *orktypes.HookTemplates)
MergeHookTemplates appends resources from src into dst.
func ValidateMotifTemplates ¶
ValidateMotifTemplates checks that all inputs.X references in the resource YAML correspond to declared input names. Returns a list of error strings.
Types ¶
type ExpandedMotif ¶
type ExpandedMotif struct {
Resources *orktypes.HookTemplates
Status *orktypes.StatusConfig
Admission *orktypes.Admission
}
ExpandedMotif holds the result of expanding a motif.
func Expand ¶
Expand instantiates a Motif with the given input bindings and returns the expanded resources, status, and admission configuration.
bindings maps input name → resolved value. Required inputs missing from bindings are a validation error. Unknown inputs in bindings are also an error. Optional inputs not in bindings use their Motif-declared defaults.
Expand replaces all `{{ .inputs.Name }}` and `{{ inputs.Name }}` expressions in the YAML of resources, status, and admission with the resolved binding values. Other template expressions (e.g., `{{ .children.* }}`) are left untouched and will be evaluated at runtime by the reconciler.
func (*ExpandedMotif) HasAdmission ¶ added in v0.4.0
func (e *ExpandedMotif) HasAdmission() bool
HasAdmission reports whether the motif includes admission rules.
func (*ExpandedMotif) HasResources ¶ added in v0.4.0
func (e *ExpandedMotif) HasResources() bool
HasResources returns true when the motif produced resource templates.
func (*ExpandedMotif) HasStatus ¶ added in v0.4.0
func (e *ExpandedMotif) HasStatus() bool
HasStatus reports whether the motif defines status fields or conditions.