engine

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package engine orchestrates a Tekton PipelineRun. It builds the DAG, resolves params and results, evaluates when-expressions, runs `finally` tasks, and drives a Backend. Pure of I/O except via the Backend and the Reporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetResultsDirProvisioner

func SetResultsDirProvisioner(fn func(parent, taskName string) (string, error))

SetResultsDirProvisioner is called once by the CLI to wire the engine's per-task results dir creation into a workspace.Manager. Tests don't need this — the unit test fake backend ignores the empty path.

Types

type Engine

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

func New

func New(be backend.Backend, rep reporter.Reporter, opts Options) *Engine

func (*Engine) RunPipeline

func (e *Engine) RunPipeline(ctx context.Context, in PipelineInput) (RunResult, error)

type Options

type Options struct {
	MaxParallel int
	// VolumeResolver materialises a Task's volumes onto host paths just
	// before the task runs. The CLI sets this; tests may leave it nil
	// (volumes are then unsupported in that test).
	VolumeResolver VolumeResolver
}

type PipelineInput

type PipelineInput struct {
	Bundle     *loader.Bundle
	Name       string                            // pipeline name
	Params     map[string]tektontypes.ParamValue // user-provided params
	Workspaces map[string]string                 // pipeline workspace name → host path
	RunID      string                            // optional; auto-generated if empty
}

PipelineInput names what to run and how.

type RunResult

type RunResult struct {
	Status string // succeeded | failed
	Tasks  map[string]TaskOutcome
	// Reason is the backend-supplied terminal reason. On the cluster
	// backend this is the Tekton condition reason verbatim
	// (PipelineRunTimeout, PipelineValidationFailed, Failed, …); on
	// the docker backend it's empty. Surfaced for diagnostic logging
	// only — the user-visible status enum lives in Status.
	Reason string
	// Message is the backend-supplied terminal message. Same purpose
	// as Reason — surfaced so failure logs can attribute a misclassified
	// run to a specific backend code path.
	Message string
}

RunResult is the outcome of a pipeline run.

type TaskOutcome

type TaskOutcome struct {
	Status   string
	Message  string
	Results  map[string]string
	Attempt  int           // final attempt number (1-based); 0 = did not run
	Duration time.Duration // duration of the final attempt
}

type VolumeResolver added in v1.2.0

type VolumeResolver func(taskName string, vs []tektontypes.Volume) (map[string]string, error)

VolumeResolver is the engine's hook for the volumes package. Returns map[volumeName] -> hostPath.

Directories

Path Synopsis
Package dag implements a small directed acyclic graph: build, topological level grouping, cycle detection, descendant traversal.
Package dag implements a small directed acyclic graph: build, topological level grouping, cycle detection, descendant traversal.

Jump to

Keyboard shortcuts

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