OAM Model

OAM Model, Parser & Transformer

Go Reference Go Reference

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

KindTypePurpose
ApplicationApplicationThe app: components[] (each with type + properties) and traits[].
PackagePackageA parameterized, distributable unit: app.yaml + a kurel.yaml parameter schema (ParameterDecl).
ClusterProfileClusterProfilePlatform choices (trait implementations, capabilities) supplied at build time.
CapabilityDefinitionCapabilityDefinitionDeclares a capability’s rendering/property schema for validation.

Pipeline

parse → resolve parameters → transform (component + trait handlers) → manifests
  1. Parse an Application/Package/ClusterProfile from YAML.
  2. Resolve parameters (ResolveParameters) — apply kurel.yaml declarations, values files, and --set overrides via ${var} substitution.
  3. Transform (Transformer) — dispatch each component to its ComponentHandler and each trait to its TraitHandler, merging the ClusterProfile’s capability choices.

Parsing

FunctionPurpose
Parse / ParseMulti / MustParseParse one / many Application documents.
ParsePackageParse a Package (app + parameter schema).
ParseClusterProfileParse a ClusterProfile.
LoadCapabilityDefinitionsLoad CapabilityDefinitions for capability validation.
ParseWithExtraTraitTypesParse 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:

InterfaceRole
ComponentHandlerCanHandle(type) + ToApplicationConfig(...) — see components.
TraitHandlerCanHandle(type) + Apply(...) — see traits.
PolicyHandlerEnforce/validate policies (Enforceable, PolicyResult).
CapabilityAwareMark a handler as requiring a ClusterProfile capability.
SourceDeduplicatableCollapse 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.