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 ¶
- type ConfigMapSource
- type EmptyDirSource
- type EnvVar
- type HostPathSource
- type KeyToPath
- type Metadata
- type Object
- type Param
- type ParamSpec
- type ParamType
- type ParamValue
- type Pipeline
- type PipelineRef
- type PipelineResultSpec
- type PipelineRun
- type PipelineRunSpec
- type PipelineRunWSBinding
- type PipelineSpec
- type PipelineTask
- type PipelineWorkspaceDecl
- type ResourceList
- type ResultSpec
- type SecretSource
- type Step
- type StepResources
- type Task
- type TaskRef
- type TaskRun
- type TaskRunSpec
- type TaskSpec
- type Timeouts
- type Volume
- type VolumeMount
- type WhenExpression
- type WorkspaceBinding
- type WorkspaceDecl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMapSource ¶ added in v1.2.0
type EmptyDirSource ¶ added in v1.2.0
type EmptyDirSource struct {
// Medium: "" (disk-backed tmpdir) or "Memory" (tmpfs on Linux).
Medium string `json:"medium,omitempty"`
}
type HostPathSource ¶ added in v1.2.0
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 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 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"`
Timeouts *Timeouts `json:"timeouts,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"`
// Retries is the number of additional attempts after the first failure.
// 0 (or unset) means run once.
Retries int `json:"retries,omitempty"`
}
type PipelineWorkspaceDecl ¶
type ResourceList ¶
type ResultSpec ¶
type SecretSource ¶ added in v1.2.0
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
// OnError controls Task-level failure semantics. "" or "stopAndFail" is
// the default — first non-zero step exit fails the Task. "continue" lets
// a non-zero exit be recorded but does not fail the Task.
OnError string `json:"onError,omitempty"`
// Results are per-step results, mounted at /tekton/steps/<step>/results/
// in this step (RW) and in every later step in the same Task (RO).
Results []ResultSpec `json:"results,omitempty"`
VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
}
type StepResources ¶
type StepResources struct {
Limits ResourceList `json:"limits,omitempty"`
Requests ResourceList `json:"requests,omitempty"`
}
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"`
// Timeout is a Go duration string (e.g. "30s", "5m"). Empty means no
// task-level timeout.
Timeout string `json:"timeout,omitempty"`
Volumes []Volume `json:"volumes,omitempty"`
}
type Timeouts ¶ added in v1.3.0
type Timeouts struct {
Pipeline string `json:"pipeline,omitempty"`
Tasks string `json:"tasks,omitempty"`
Finally string `json:"finally,omitempty"`
}
Timeouts mirrors Tekton's PipelineSpec.Timeouts (tekton.dev/v1).
Each field is a Go-style time.Duration string (e.g. "30s", "5m", "2h"). Unset fields mean "no budget at this level". Validator enforces: durations parseable, none equals zero, and tasks+finally ≤ pipeline when all three are set.
type Volume ¶ added in v1.2.0
type Volume struct {
Name string `json:"name"`
EmptyDir *EmptyDirSource `json:"emptyDir,omitempty"`
HostPath *HostPathSource `json:"hostPath,omitempty"`
ConfigMap *ConfigMapSource `json:"configMap,omitempty"`
Secret *SecretSource `json:"secret,omitempty"`
}
Volume is a Task-level volume. Exactly one of EmptyDir/HostPath/ConfigMap/ Secret must be set; any other source kind is rejected by the validator.