Documentation
¶
Overview ¶
Package backend defines the contract between the engine and an execution substrate (Docker, k3d, ...).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
// Prepare runs once before any task. Pulls images, creates networks, etc.
Prepare(ctx context.Context, run RunSpec) error
// RunTask executes a single TaskInvocation and returns its result.
// Implementations stream logs through inv.LogSink.
RunTask(ctx context.Context, inv TaskInvocation) (TaskResult, error)
// Cleanup runs once after all tasks (success or failure). Removes containers,
// temporary networks, etc. Workspace cleanup is the engine's responsibility.
Cleanup(ctx context.Context) error
}
Backend executes Tasks. The engine drives one Backend per run.
type RunSpec ¶
type RunSpec struct {
RunID string // stable per-invocation
Pipeline string // pipeline name (or task name in single-task mode)
Images []string // images to pre-pull
Workspaces map[string]string // workspace name → host path
}
RunSpec describes the whole run that's about to start.
type StepResult ¶
type StepStatus ¶
type StepStatus string
const ( StepSucceeded StepStatus = "succeeded" StepFailed StepStatus = "failed" StepSkipped StepStatus = "skipped" )
type TaskInvocation ¶
type TaskInvocation struct {
RunID string
PipelineRun string
TaskRunName string // <pipelineRun>-<task>
Task tektontypes.TaskSpec // resolved spec — no $(params.x) left
Params map[string]tektontypes.ParamValue // already-evaluated params
Workspaces map[string]WorkspaceMount // task-workspace-name → host mount
ContextVars map[string]string // $(context.taskRun.name) etc.
LogSink LogSink // engine-supplied sink
ResultsHost string // host dir bind-mounted as /tekton/results
}
TaskInvocation is one PipelineTask, fully resolved (params substituted).
type TaskResult ¶
type TaskResult struct {
Status TaskStatus
Started time.Time
Ended time.Time
Steps []StepResult
Results map[string]string // result name → value (read from /tekton/results/<name>)
Err error // populated when Status is TaskInfraFailed
}
TaskResult is what RunTask returns.
type TaskStatus ¶
type TaskStatus string
const ( TaskSucceeded TaskStatus = "succeeded" TaskFailed TaskStatus = "failed" // a step exited non-zero TaskInfraFailed TaskStatus = "infrafailed" // backend/env error before/around step TaskNotRun TaskStatus = "not-run" // skipped because a dep failed TaskSkipped TaskStatus = "skipped" // when expression false )
type WorkspaceMount ¶
Click to show internal directories.
Click to hide internal directories.