tektontypes

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package tektontypes defines minimal Go types matching the tekton.dev/v1 schema for Task, TaskRun, Pipeline, and PipelineRun. JSON tags align with upstream so `kubectl apply -f` and `tkn-act` parse the same YAML identically.

Scope is intentionally narrow — only fields that the v1 implementation actually reads. Fields we don't support (sidecars, stepActions, retries, resolvers) are not parsed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvVar

type EnvVar struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Metadata

type Metadata struct {
	Name        string            `json:"name"`
	Namespace   string            `json:"namespace,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

type Object

type Object struct {
	APIVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	Metadata   Metadata `json:"metadata"`
}

Object is the common envelope shared by Task/Pipeline/TaskRun/PipelineRun.

type Param

type Param struct {
	Name  string     `json:"name"`
	Value ParamValue `json:"value"`
}

type ParamSpec

type ParamSpec struct {
	Name        string      `json:"name"`
	Type        ParamType   `json:"type,omitempty"` // default string
	Description string      `json:"description,omitempty"`
	Default     *ParamValue `json:"default,omitempty"`
}

type ParamType

type ParamType string
const (
	ParamTypeString ParamType = "string"
	ParamTypeArray  ParamType = "array"
	ParamTypeObject ParamType = "object"
)

type ParamValue

type ParamValue struct {
	Type      ParamType
	StringVal string
	ArrayVal  []string
	ObjectVal map[string]string
}

ParamValue can be a string, []string, or map[string]string. Custom JSON unmarshaler picks the right shape from the input.

func (ParamValue) MarshalJSON

func (v ParamValue) MarshalJSON() ([]byte, error)

func (*ParamValue) UnmarshalJSON

func (v *ParamValue) UnmarshalJSON(data []byte) error

type Pipeline

type Pipeline struct {
	Object `json:",inline"`
	Spec   PipelineSpec `json:"spec"`
}

type PipelineRef

type PipelineRef struct {
	Name string `json:"name"`
}

type PipelineResultSpec

type PipelineResultSpec struct {
	Name        string     `json:"name"`
	Description string     `json:"description,omitempty"`
	Value       ParamValue `json:"value"`
}

type PipelineRun

type PipelineRun struct {
	Object `json:",inline"`
	Spec   PipelineRunSpec `json:"spec"`
}

type PipelineRunSpec

type PipelineRunSpec struct {
	PipelineRef  *PipelineRef           `json:"pipelineRef,omitempty"`
	PipelineSpec *PipelineSpec          `json:"pipelineSpec,omitempty"`
	Params       []Param                `json:"params,omitempty"`
	Workspaces   []PipelineRunWSBinding `json:"workspaces,omitempty"`
}

type PipelineRunWSBinding

type PipelineRunWSBinding struct {
	Name     string    `json:"name"`
	EmptyDir *struct{} `json:"emptyDir,omitempty"`
	HostPath string    `json:"-"` // tkn-act extension; populated from CLI -w flag
}

type PipelineSpec

type PipelineSpec struct {
	Description string                  `json:"description,omitempty"`
	Params      []ParamSpec             `json:"params,omitempty"`
	Workspaces  []PipelineWorkspaceDecl `json:"workspaces,omitempty"`
	Tasks       []PipelineTask          `json:"tasks"`
	Finally     []PipelineTask          `json:"finally,omitempty"`
	Results     []PipelineResultSpec    `json:"results,omitempty"`
}

type PipelineTask

type PipelineTask struct {
	Name       string             `json:"name"`
	TaskRef    *TaskRef           `json:"taskRef,omitempty"`
	TaskSpec   *TaskSpec          `json:"taskSpec,omitempty"` // inline task
	Params     []Param            `json:"params,omitempty"`
	Workspaces []WorkspaceBinding `json:"workspaces,omitempty"`
	RunAfter   []string           `json:"runAfter,omitempty"`
	When       []WhenExpression   `json:"when,omitempty"`
}

type PipelineWorkspaceDecl

type PipelineWorkspaceDecl struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Optional    bool   `json:"optional,omitempty"`
}

type ResourceList

type ResourceList struct {
	CPU    string `json:"cpu,omitempty"`
	Memory string `json:"memory,omitempty"`
}

type ResultSpec

type ResultSpec struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"` // string|array|object; default string
}

type Step

type Step struct {
	Name            string         `json:"name"`
	Image           string         `json:"image"`
	Command         []string       `json:"command,omitempty"`
	Args            []string       `json:"args,omitempty"`
	Script          string         `json:"script,omitempty"`
	Env             []EnvVar       `json:"env,omitempty"`
	WorkingDir      string         `json:"workingDir,omitempty"`
	Resources       *StepResources `json:"resources,omitempty"`
	ImagePullPolicy string         `json:"imagePullPolicy,omitempty"` // Always | IfNotPresent | Never
}

type StepResources

type StepResources struct {
	Limits   ResourceList `json:"limits,omitempty"`
	Requests ResourceList `json:"requests,omitempty"`
}

type Task

type Task struct {
	Object `json:",inline"`
	Spec   TaskSpec `json:"spec"`
}

type TaskRef

type TaskRef struct {
	Name string `json:"name"`
	Kind string `json:"kind,omitempty"` // Task|ClusterTask; default Task
}

type TaskRun

type TaskRun struct {
	Object `json:",inline"`
	Spec   TaskRunSpec `json:"spec"`
}

type TaskRunSpec

type TaskRunSpec struct {
	TaskRef    *TaskRef           `json:"taskRef,omitempty"`
	TaskSpec   *TaskSpec          `json:"taskSpec,omitempty"`
	Params     []Param            `json:"params,omitempty"`
	Workspaces []WorkspaceBinding `json:"workspaces,omitempty"`
}

type TaskSpec

type TaskSpec struct {
	Params      []ParamSpec     `json:"params,omitempty"`
	Results     []ResultSpec    `json:"results,omitempty"`
	Workspaces  []WorkspaceDecl `json:"workspaces,omitempty"`
	Steps       []Step          `json:"steps"`
	Description string          `json:"description,omitempty"`
}

type WhenExpression

type WhenExpression struct {
	Input    string   `json:"input"`
	Operator string   `json:"operator"` // "in" | "notin"
	Values   []string `json:"values"`
}

type WorkspaceBinding

type WorkspaceBinding struct {
	Name      string `json:"name"`      // workspace name as declared in the Task
	Workspace string `json:"workspace"` // pipeline workspace it binds to
	SubPath   string `json:"subPath,omitempty"`
}

type WorkspaceDecl

type WorkspaceDecl struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	MountPath   string `json:"mountPath,omitempty"`
	ReadOnly    bool   `json:"readOnly,omitempty"`
	Optional    bool   `json:"optional,omitempty"`
}

Jump to

Keyboard shortcuts

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