workflowpipeline

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package workflowpipeline provides workflow rendering by combining CRs and evaluating CEL expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline orchestrates workflow rendering by combining WorkflowRun, Workflow to generate fully resolved resources (e.g., Argo Workflow).

func NewPipeline

func NewPipeline() *Pipeline

NewPipeline creates a new workflow rendering pipeline.

func (*Pipeline) BuildCELContext added in v0.17.0

func (p *Pipeline) BuildCELContext(input *RenderInput) (map[string]any, error)

BuildCELContext builds the CEL evaluation context with metadata.*, parameters.*, and externalRefs variables.

func (*Pipeline) Render

func (p *Pipeline) Render(input *RenderInput) (*RenderOutput, error)

Render orchestrates the complete workflow rendering process. It validates input, builds CEL context, renders the template, and validates output.

type RenderInput

type RenderInput struct {
	// WorkflowRun is the workflow execution instance with developer parameters (required).
	WorkflowRun *v1alpha1.WorkflowRun

	// Workflow contains the schema and resource template (required).
	Workflow *v1alpha1.Workflow

	// Context provides workflow execution context metadata (required).
	Context WorkflowContext
}

RenderInput contains all required inputs for workflow rendering.

type RenderMetadata

type RenderMetadata struct {
	// Warnings lists non-fatal issues encountered during rendering.
	Warnings []string
}

RenderMetadata contains non-fatal information about the rendering process.

type RenderOutput

type RenderOutput struct {
	// Resource is the fully rendered workflow resource as a map that can be converted
	// to unstructured.Unstructured for Kubernetes API operations.
	Resource map[string]any

	// Resources contains additional rendered Kubernetes resources (e.g., secrets, configmaps)
	// to be applied alongside the main workflow resource.
	Resources []RenderedResource

	// Metadata contains rendering process information such as warnings.
	Metadata *RenderMetadata
}

RenderOutput contains the rendered workflow resource and associated metadata.

type RenderedResource added in v0.11.0

type RenderedResource struct {
	// ID is the unique identifier for this resource from the Workflow spec.
	ID string

	// Resource is the fully rendered Kubernetes resource as a map.
	Resource map[string]any
}

RenderedResource represents a rendered Kubernetes resource with its identifier.

type WorkflowContext

type WorkflowContext struct {
	// NamespaceName is the namespace name.
	NamespaceName string

	// WorkflowRunName is the name of the workflow run CR.
	WorkflowRunName string

	// Labels contains the WorkflowRun labels, exposed to CEL as ${metadata.labels['key']}.
	Labels map[string]string

	// ExternalRefs contains resolved external CR specs keyed by their id.
	// Entries are injected into the CEL context under the "externalRefs" map
	// and accessed as ${externalRefs['<id>'].spec.*}, e.g. ${externalRefs['git-secret-reference'].spec.template.type}.
	ExternalRefs map[string]any

	// WorkflowPlane contains workflow plane configuration data exposed to CEL as ${workflowplane.*}.
	WorkflowPlane WorkflowPlaneData
}

WorkflowContext provides contextual metadata for workflow rendering. These values are injected into CEL expressions as ${metadata.*} variables.

type WorkflowPlaneData added in v1.0.0

type WorkflowPlaneData struct {
	// SecretStore is the name of the ESO ClusterSecretStore configured on the workflow plane.
	// Exposed as ${workflowplane.secretStore}.
	SecretStore string
}

WorkflowPlaneData contains workflow plane configuration exposed to CEL templates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL