Documentation
¶
Overview ¶
Package component provides the main rendering pipeline for Component resources.
The pipeline combines Component, ComponentType, Traits, Workload and ComponentDeployment to generate fully resolved Kubernetes resource manifests by:
- Building CEL evaluation contexts with parameters, overrides, and defaults
- Rendering base resources from ComponentType
- Processing traits (creates and patches)
- Post-processing (validation, labels, annotations)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Pipeline)
Option is a function that configures a Pipeline.
func WithResourceAnnotations ¶
WithResourceAnnotations adds annotations to all rendered resources. These annotations are merged with any existing annotations on the resources.
func WithResourceLabels ¶
WithResourceLabels adds labels to all rendered resources. These labels are merged with any existing labels on the resources.
func WithValidation ¶
WithValidation enables or disables resource validation. When enabled, rendered resources are validated to ensure they have required fields (kind, apiVersion, metadata.name). Validation failures always cause rendering to fail.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline orchestrates the complete rendering workflow for Component resources. It combines Component, ComponentType, Traits, Workload and ComponentDeployment to generate fully resolved Kubernetes resource manifests.
func NewPipeline ¶
NewPipeline creates a new component rendering pipeline.
func (*Pipeline) Render ¶
func (p *Pipeline) Render(input *RenderInput) (*RenderOutput, error)
Render orchestrates the complete rendering workflow for a Component.
Workflow:
- Validate input
- Build component context (parameters + overrides + defaults)
- Render base resources from ComponentType
- Process traits (creates and patches)
- Post-process (validate, add labels/annotations, sort)
- Return output
Returns an error if any step fails.
type RenderInput ¶
type RenderInput struct {
// ComponentType is the component type containing resource templates.
// Required.
ComponentType *v1alpha1.ComponentType
// Component is the component specification with parameters.
// Required.
Component *v1alpha1.Component
// Traits is the list of trait definitions used by the component.
// Optional - if nil or empty, no traits are processed.
Traits []v1alpha1.Trait
// Workload contains the workload spec with build information.
// Required.
Workload *v1alpha1.Workload
// Environment to which the component is being deployed.
// Required.
Environment *v1alpha1.Environment
// ComponentDeployment contains environment-specific overrides for the component.
// Optional - if nil, no environment overrides are applied.
ComponentDeployment *v1alpha1.ComponentDeployment
// DataPlane contains the data plane configuration.
// Optional - can be nil if no data plane is configured.
DataPlane *v1alpha1.DataPlane
// SecretReferences is a map of SecretReference objects needed for rendering.
// Keyed by SecretReference name.
// Optional - can be nil if no secret references need to be resolved.
SecretReferences map[string]*v1alpha1.SecretReference
// Metadata provides structured naming information.
// Required - controller must compute and provide this.
Metadata pipelinecontext.MetadataContext
}
RenderInput contains all inputs needed to render a component's resources.
type RenderMetadata ¶
type RenderMetadata struct {
// ResourceCount is the total number of resources rendered.
ResourceCount int
// BaseResourceCount is the number of resources from the ComponentType.
BaseResourceCount int
// TraitCount is the number of traits processed.
TraitCount int
// TraitResourceCount is the number of resources created by traits.
TraitResourceCount int
// Warnings contains non-fatal issues encountered during rendering.
Warnings []string
}
RenderMetadata contains information about the rendering process.
type RenderOptions ¶
type RenderOptions struct {
// EnableValidation enables resource validation after rendering.
// When enabled, resources missing required fields (apiVersion, kind, metadata.name) will cause rendering to fail.
EnableValidation bool
// ResourceLabels are additional labels to add to all rendered resources.
ResourceLabels map[string]string
// ResourceAnnotations are additional annotations to add to all rendered resources.
ResourceAnnotations map[string]string
}
RenderOptions configures the rendering behavior.
func DefaultRenderOptions ¶
func DefaultRenderOptions() RenderOptions
DefaultRenderOptions returns the default rendering options.
type RenderOutput ¶
type RenderOutput struct {
// Resources is the list of fully rendered Kubernetes resource manifests.
Resources []map[string]any
// Metadata contains information about the rendering process.
Metadata *RenderMetadata
}
RenderOutput contains the results of the rendering process.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package renderer handles ResourceTemplate orchestration for ComponentTypes.
|
Package renderer handles ResourceTemplate orchestration for ComponentTypes. |
|
Package trait handles trait processing for component rendering.
|
Package trait handles trait processing for component rendering. |