OAM Model
OAM Model, Parser & Transformer
Package oam is launcher’s core: the OAM data model, YAML parser, semantic
validator, and the transform pipeline that turns an Application + ClusterProfile
into Kubernetes manifests. All documents use apiVersion: launcher.gokure.dev/v1alpha1.
Document kinds
| Kind | Type | Purpose |
|---|---|---|
Application | Application | The app: components[] (each with type + properties) and traits[]. |
Package | Package | A parameterized, distributable unit: app.yaml + a kurel.yaml parameter schema (ParameterDecl). |
ClusterProfile | ClusterProfile | Platform choices (trait implementations, capabilities) supplied at build time. |
CapabilityDefinition | CapabilityDefinition | Declares a capability’s rendering/property schema for validation. |
Pipeline
- Parse an Application/Package/ClusterProfile from YAML.
- Resolve parameters (
ResolveParameters) — applykurel.yamldeclarations, values files, and--setoverrides via${var}substitution. - Transform (
Transformer) — dispatch each component to itsComponentHandlerand each trait to itsTraitHandler, merging theClusterProfile’s capability choices.
Parsing
| Function | Purpose |
|---|---|
Parse / ParseMulti / MustParse | Parse one / many Application documents. |
ParsePackage | Parse a Package (app + parameter schema). |
ParseClusterProfile | Parse a ClusterProfile. |
LoadCapabilityDefinitions | Load CapabilityDefinitions for capability validation. |
ParseWithExtraTraitTypes | Parse allowing additional (custom) trait types. |
Transform & extension
NewTransformer(...) builds a transformer from maps of component/trait handlers;
pkg/cmd/kurel registers the built-ins. Extend the system by implementing:
| Interface | Role |
|---|---|
ComponentHandler | CanHandle(type) + ToApplicationConfig(...) — see components. |
TraitHandler | CanHandle(type) + Apply(...) — see traits. |
PolicyHandler | Enforce/validate policies (Enforceable, PolicyResult). |
CapabilityAware | Mark a handler as requiring a ClusterProfile capability. |
SourceDeduplicatable | Collapse duplicate sources (e.g. shared OCI/Helm repos). |
Capability system
Capability-aware traits (e.g. expose, certificate, external-secret) declare
required platform inputs; the ClusterProfile provides them, and
CapabilityDefinition rendering/property schemas validate custom capabilities
(--strict-capabilities turns warnings into errors).
This is a large internal builder surface; the tables above cover the entry points.
See pkg.go.dev for the full
type reference, the design notes under the Concepts section, and examples/ for
runnable applications.