Skip to main content

Extending

Extending

Custom component types implement oam.ComponentHandler (CanHandle + ToApplicationConfig) and are registered alongside the built-ins. Exported helpers: ValidateImageRef (image policy, the tagged level) and ValidateImageRefAt (the level a handler reads from Component.ImageLevel()), BuildPVC (PVC from a PVCConfig), and the persistentvolumeclaim kind’s claim path, ParseClaimProperties, ApplyClaimPolicy and GenerateClaim, which the pvc trait builds through. A custom Generate() that builds standalone PVCs from a PVCConfig list should qualify their names with the component name the way the role kinds do — see roleClaims (unexported, role_members.go) — to avoid two components colliding on the same pod-local volume name.

See pkg.go.dev for the full type/field reference, the OAM model for the handler interfaces, and examples/ for runnable applications.