Documentation ¶
Overview ¶
Copyright 2022 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package v1 contains API Schema definitions for the pipeline v1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/tektoncd/pipeline/pkg/apis/pipeline +k8s:defaulter-gen=TypeMeta +groupName=tekton.dev
Index ¶
- Constants
- Variables
- func ArrayReference(a string) string
- func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
- func GetVarSubstitutionExpressionsForParam(param Param) ([]string, bool)
- func GetVarSubstitutionExpressionsForPipelineResult(result PipelineResult) ([]string, bool)
- func Kind(kind string) schema.GroupKind
- func LooksLikeContainsResultRefs(expressions []string) bool
- func ParseResultName(resultName string) (string, string)
- func Resource(resource string) schema.GroupResource
- func ResultsArrayReference(a string) string
- func StripStarVarSubExpression(s string) string
- func ValidateEmbeddedStatus(ctx context.Context, featureName, wantEmbeddedStatus string) *apis.FieldError
- func ValidateObjectKeys(properties map[string]PropertySpec, propertiesProvider *ParamValue) (errs *apis.FieldError)
- func ValidateParameterTypes(ctx context.Context, params []ParamSpec) (errs *apis.FieldError)
- func ValidateParameterVariables(ctx context.Context, steps []Step, params []ParamSpec) *apis.FieldError
- func ValidatePipelineTasks(ctx context.Context, tasks []PipelineTask, finalTasks []PipelineTask) *apis.FieldError
- func ValidateVolumes(volumes []corev1.Volume) (errs *apis.FieldError)
- type EmbeddedTask
- type OnErrorType
- type Param
- type ParamSpec
- type ParamType
- type ParamValue
- func (paramValues *ParamValue) ApplyReplacements(stringReplacements map[string]string, arrayReplacements map[string][]string, ...)
- func (in *ParamValue) DeepCopy() *ParamValue
- func (in *ParamValue) DeepCopyInto(out *ParamValue)
- func (paramValues ParamValue) MarshalJSON() ([]byte, error)
- func (paramValues *ParamValue) UnmarshalJSON(value []byte) error
- type Pipeline
- func (p *Pipeline) ConvertFrom(ctx context.Context, source apis.Convertible) error
- func (p *Pipeline) ConvertTo(ctx context.Context, sink apis.Convertible) error
- func (in *Pipeline) DeepCopy() *Pipeline
- func (in *Pipeline) DeepCopyInto(out *Pipeline)
- func (in *Pipeline) DeepCopyObject() runtime.Object
- func (*Pipeline) GetGroupVersionKind() schema.GroupVersionKind
- func (p *Pipeline) PipelineMetadata() metav1.ObjectMeta
- func (p *Pipeline) PipelineSpec() PipelineSpec
- func (p *Pipeline) SetDefaults(ctx context.Context)
- func (p *Pipeline) Validate(ctx context.Context) *apis.FieldError
- type PipelineList
- type PipelineResult
- type PipelineSpec
- type PipelineTask
- func (in *PipelineTask) DeepCopy() *PipelineTask
- func (in *PipelineTask) DeepCopyInto(out *PipelineTask)
- func (pt PipelineTask) Deps() []string
- func (pt *PipelineTask) GetMatrixCombinationsCount() int
- func (pt PipelineTask) HashKey() string
- func (pt *PipelineTask) TaskSpecMetadata() PipelineTaskMetadata
- func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError)
- func (pt PipelineTask) ValidateName() *apis.FieldError
- type PipelineTaskList
- func (in PipelineTaskList) DeepCopy() PipelineTaskList
- func (in PipelineTaskList) DeepCopyInto(out *PipelineTaskList)
- func (l PipelineTaskList) Deps() map[string][]string
- func (l PipelineTaskList) Items() []dag.Task
- func (l PipelineTaskList) Names() sets.String
- func (l PipelineTaskList) Validate(ctx context.Context, taskNames sets.String, path string) (errs *apis.FieldError)
- type PipelineTaskMetadata
- type PipelineTaskParam
- type PipelineWorkspaceDeclaration
- type PropertySpec
- type ResolverName
- type ResolverParam
- type ResolverRef
- type ResourceParam
- type ResultRef
- type ResultValue
- type ResultsType
- type Sidecar
- type Step
- type StepOutputConfig
- type StepTemplate
- type Task
- func (t *Task) ConvertFrom(ctx context.Context, source apis.Convertible) error
- func (t *Task) ConvertTo(ctx context.Context, sink apis.Convertible) error
- func (in *Task) DeepCopy() *Task
- func (in *Task) DeepCopyInto(out *Task)
- func (in *Task) DeepCopyObject() runtime.Object
- func (*Task) GetGroupVersionKind() schema.GroupVersionKind
- func (t *Task) SetDefaults(ctx context.Context)
- func (t *Task) Validate(ctx context.Context) *apis.FieldError
- type TaskKind
- type TaskList
- type TaskRef
- type TaskResult
- type TaskRunResult
- type TaskSpec
- type WhenExpression
- type WhenExpressions
- func (wes WhenExpressions) AllowsExecution() bool
- func (in WhenExpressions) DeepCopy() WhenExpressions
- func (in WhenExpressions) DeepCopyInto(out *WhenExpressions)
- func (wes WhenExpressions) ReplaceWhenExpressionsVariables(replacements map[string]string, arrayReplacements map[string][]string) WhenExpressions
- type WorkspaceBinding
- type WorkspaceDeclaration
- type WorkspacePipelineDeclaration
- type WorkspacePipelineTaskBinding
- type WorkspaceUsage
Constants ¶
const ( // PipelineTasksAggregateStatus is a param representing aggregate status of all dag pipelineTasks PipelineTasksAggregateStatus = "tasks.status" // PipelineTasks is a value representing a task is a member of "tasks" section of the pipeline PipelineTasks = "tasks" // PipelineFinallyTasks is a value representing a task is a member of "finally" section of the pipeline PipelineFinallyTasks = "finally" )
const ( // ResultTaskPart Constant used to define the "tasks" part of a pipeline result reference ResultTaskPart = "tasks" // ResultResultPart Constant used to define the "results" part of a pipeline result reference ResultResultPart = "results" )
const ParamsPrefix = "params"
ParamsPrefix is the prefix used in $(...) expressions referring to parameters
const ResultNameFormat = `^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`
ResultNameFormat Constant used to define the the regex Result.Name should follow
Variables ¶
var (
// AddToScheme adds Build types to the scheme.
AddToScheme = schemeBuilder.AddToScheme
)
var AllParamTypes = []ParamType{ParamTypeString, ParamTypeArray, ParamTypeObject}
AllParamTypes can be used for ParamType validation.
var AllResultsTypes = []ResultsType{ResultsTypeString, ResultsTypeArray, ResultsTypeObject}
AllResultsTypes can be used for ResultsTypes validation.
var SchemeGroupVersion = schema.GroupVersion{Group: pipeline.GroupName, Version: "v1"}
SchemeGroupVersion is group version used to register these objects
var VariableSubstitutionRegex = regexp.MustCompile(variableSubstitutionFormat)
VariableSubstitutionRegex is a regex to find all result matching substitutions
Functions ¶
func ArrayReference ¶
ArrayReference returns the name of the parameter from array parameter reference returns arrayParam from $(params.arrayParam[*])
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition
func GetVarSubstitutionExpressionsForParam ¶ added in v0.39.0
GetVarSubstitutionExpressionsForParam extracts all the value between "$(" and ")"" for a parameter
func GetVarSubstitutionExpressionsForPipelineResult ¶ added in v0.39.0
func GetVarSubstitutionExpressionsForPipelineResult(result PipelineResult) ([]string, bool)
GetVarSubstitutionExpressionsForPipelineResult extracts all the value between "$(" and ")"" for a pipeline result
func LooksLikeContainsResultRefs ¶ added in v0.39.0
LooksLikeContainsResultRefs attempts to check if param or a pipeline result looks like it contains any result references. This is useful if we want to make sure the param looks like a ResultReference before performing strict validation
func ParseResultName ¶ added in v0.39.0
ParseResultName parse the input string to extract resultName and result index. Array indexing: Input: anArrayResult[1] Output: anArrayResult, "1" Array star reference: Input: anArrayResult[*] Output: anArrayResult, "*"
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
func ResultsArrayReference ¶
ResultsArrayReference returns the reference of the result. e.g. results.resultname from $(results.resultname[*])
func StripStarVarSubExpression ¶
StripStarVarSubExpression strips "$(target[*])"" to get "target"
func ValidateEmbeddedStatus ¶ added in v0.39.0
func ValidateEmbeddedStatus(ctx context.Context, featureName, wantEmbeddedStatus string) *apis.FieldError
ValidateEmbeddedStatus checks that the embedded-status feature gate is set to the wantEmbeddedStatus value and, if not, returns an error stating which feature is dependent on the status and what the current status actually is.
func ValidateObjectKeys ¶
func ValidateObjectKeys(properties map[string]PropertySpec, propertiesProvider *ParamValue) (errs *apis.FieldError)
ValidateObjectKeys validates if object keys defined in properties are all provided in its value provider iff the provider is not nil.
func ValidateParameterTypes ¶
func ValidateParameterTypes(ctx context.Context, params []ParamSpec) (errs *apis.FieldError)
ValidateParameterTypes validates all the types within a slice of ParamSpecs
func ValidateParameterVariables ¶
func ValidateParameterVariables(ctx context.Context, steps []Step, params []ParamSpec) *apis.FieldError
ValidateParameterVariables validates all variables within a slice of ParamSpecs against a slice of Steps
func ValidatePipelineTasks ¶ added in v0.39.0
func ValidatePipelineTasks(ctx context.Context, tasks []PipelineTask, finalTasks []PipelineTask) *apis.FieldError
ValidatePipelineTasks ensures that pipeline tasks has unique label, pipeline tasks has specified one of taskRef or taskSpec, and in case of a pipeline task with taskRef, it has a reference to a valid task (task name)
func ValidateVolumes ¶
func ValidateVolumes(volumes []corev1.Volume) (errs *apis.FieldError)
ValidateVolumes validates a slice of volumes to make sure there are no dupilcate names
Types ¶
type EmbeddedTask ¶ added in v0.39.0
type EmbeddedTask struct { // +optional runtime.TypeMeta `json:",inline,omitempty"` // Spec is a specification of a custom task // +optional Spec runtime.RawExtension `json:"spec,omitempty"` // +optional Metadata PipelineTaskMetadata `json:"metadata,omitempty"` // TaskSpec is a specification of a task // +optional TaskSpec `json:",inline,omitempty"` }
EmbeddedTask is used to define a Task inline within a Pipeline's PipelineTasks.
func (*EmbeddedTask) DeepCopy ¶ added in v0.39.0
func (in *EmbeddedTask) DeepCopy() *EmbeddedTask
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedTask.
func (*EmbeddedTask) DeepCopyInto ¶ added in v0.39.0
func (in *EmbeddedTask) DeepCopyInto(out *EmbeddedTask)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OnErrorType ¶ added in v0.39.0
type OnErrorType string
OnErrorType defines a list of supported exiting behavior of a container on error
const ( // StopAndFail indicates exit the taskRun if the container exits with non-zero exit code StopAndFail OnErrorType = "stopAndFail" // Continue indicates continue executing the rest of the steps irrespective of the container exit code Continue OnErrorType = "continue" )
type Param ¶
type Param struct { Name string `json:"name"` Value ParamValue `json:"value"` }
Param declares an ParamValues to use for the parameter called name.
func (*Param) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Param.
func (*Param) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ParamSpec ¶
type ParamSpec struct { // Name declares the name by which a parameter is referenced. Name string `json:"name"` // Type is the user-specified type of the parameter. The possible types // are currently "string", "array" and "object", and "string" is the default. // +optional Type ParamType `json:"type,omitempty"` // Description is a user-facing description of the parameter that may be // used to populate a UI. // +optional Description string `json:"description,omitempty"` // Properties is the JSON Schema properties to support key-value pairs parameter. // +optional Properties map[string]PropertySpec `json:"properties,omitempty"` // Default is the value a parameter takes if no input value is supplied. If // default is set, a Task may be executed without a supplied value for the // parameter. // +optional Default *ParamValue `json:"default,omitempty"` }
ParamSpec defines arbitrary parameters needed beyond typed inputs (such as resources). Parameter values are provided by users as inputs on a TaskRun or PipelineRun.
func (*ParamSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParamSpec.
func (*ParamSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ParamSpec) SetDefaults ¶
SetDefaults set the default type
func (ParamSpec) ValidateObjectType ¶
func (p ParamSpec) ValidateObjectType() *apis.FieldError
ValidateObjectType checks that object type parameter does not miss the definition of `properties` section and the type of a PropertySpec is allowed. (Currently, only string is allowed)
func (ParamSpec) ValidateType ¶
func (p ParamSpec) ValidateType() *apis.FieldError
ValidateType checks that the type of a ParamSpec is allowed and its default value matches that type
type ParamType ¶
type ParamType string
ParamType indicates the type of an input parameter; Used to distinguish between a single string and an array of strings.
type ParamValue ¶ added in v0.39.0
type ParamValue struct { Type ParamType `json:"type"` // Represents the stored type of ParamValues. StringVal string `json:"stringVal"` // +listType=atomic ArrayVal []string `json:"arrayVal"` ObjectVal map[string]string `json:"objectVal"` }
ParamValue is a type that can hold a single string, string array, or string map. Used in JSON unmarshalling so that a single JSON field can accept either an individual string or an array of strings.
func NewObject ¶
func NewObject(pairs map[string]string) *ParamValue
NewObject creates an ParamValues of type ParamTypeObject using the provided key-value pairs
func NewStructuredValues ¶ added in v0.39.0
func NewStructuredValues(value string, values ...string) *ParamValue
NewStructuredValues creates an ParamValues of type ParamTypeString or ParamTypeArray, based on how many inputs are given (>1 input will create an array, not string).
func (*ParamValue) ApplyReplacements ¶ added in v0.39.0
func (paramValues *ParamValue) ApplyReplacements(stringReplacements map[string]string, arrayReplacements map[string][]string, objectReplacements map[string]map[string]string)
ApplyReplacements applyes replacements for ParamValues type
func (*ParamValue) DeepCopy ¶ added in v0.39.0
func (in *ParamValue) DeepCopy() *ParamValue
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParamValue.
func (*ParamValue) DeepCopyInto ¶ added in v0.39.0
func (in *ParamValue) DeepCopyInto(out *ParamValue)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (ParamValue) MarshalJSON ¶ added in v0.39.0
func (paramValues ParamValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface.
func (*ParamValue) UnmarshalJSON ¶ added in v0.39.0
func (paramValues *ParamValue) UnmarshalJSON(value []byte) error
UnmarshalJSON implements the json.Unmarshaller interface.
type Pipeline ¶ added in v0.39.0
type Pipeline struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata,omitempty"` // Spec holds the desired state of the Pipeline from the client // +optional Spec PipelineSpec `json:"spec"` }
Pipeline describes a list of Tasks to execute. It expresses how outputs of tasks feed into inputs of subsequent tasks. +k8s:openapi-gen=true
func (*Pipeline) ConvertFrom ¶ added in v0.39.0
ConvertFrom implements apis.Convertible
func (*Pipeline) DeepCopy ¶ added in v0.39.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pipeline.
func (*Pipeline) DeepCopyInto ¶ added in v0.39.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Pipeline) DeepCopyObject ¶ added in v0.39.0
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Pipeline) GetGroupVersionKind ¶ added in v0.39.0
func (*Pipeline) GetGroupVersionKind() schema.GroupVersionKind
GetGroupVersionKind implements kmeta.OwnerRefable.
func (*Pipeline) PipelineMetadata ¶ added in v0.39.0
func (p *Pipeline) PipelineMetadata() metav1.ObjectMeta
PipelineMetadata returns the Pipeline's ObjectMeta, implementing PipelineObject
func (*Pipeline) PipelineSpec ¶ added in v0.39.0
func (p *Pipeline) PipelineSpec() PipelineSpec
PipelineSpec returns the Pipeline's Spec, implementing PipelineObject
func (*Pipeline) SetDefaults ¶ added in v0.39.0
SetDefaults sets default values on the Pipeline's Spec
type PipelineList ¶ added in v0.39.0
type PipelineList struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ListMeta `json:"metadata,omitempty"` Items []Pipeline `json:"items"` }
PipelineList contains a list of Pipeline
func (*PipelineList) DeepCopy ¶ added in v0.39.0
func (in *PipelineList) DeepCopy() *PipelineList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineList.
func (*PipelineList) DeepCopyInto ¶ added in v0.39.0
func (in *PipelineList) DeepCopyInto(out *PipelineList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PipelineList) DeepCopyObject ¶ added in v0.39.0
func (in *PipelineList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PipelineResult ¶ added in v0.39.0
type PipelineResult struct { // Name the given name Name string `json:"name"` // Type is the user-specified type of the result. // The possible types are 'string', 'array', and 'object', with 'string' as the default. // 'array' and 'object' types are alpha features. Type ResultsType `json:"type,omitempty"` // Description is a human-readable description of the result // +optional Description string `json:"description"` // Value the expression used to retrieve the value Value ResultValue `json:"value"` }
PipelineResult used to describe the results of a pipeline
func (*PipelineResult) DeepCopy ¶ added in v0.39.0
func (in *PipelineResult) DeepCopy() *PipelineResult
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineResult.
func (*PipelineResult) DeepCopyInto ¶ added in v0.39.0
func (in *PipelineResult) DeepCopyInto(out *PipelineResult)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PipelineSpec ¶ added in v0.39.0
type PipelineSpec struct { // Description is a user-facing description of the pipeline that may be // used to populate a UI. // +optional Description string `json:"description,omitempty"` // Tasks declares the graph of Tasks that execute when this Pipeline is run. // +listType=atomic Tasks []PipelineTask `json:"tasks,omitempty"` // Params declares a list of input parameters that must be supplied when // this Pipeline is run. // +listType=atomic Params []ParamSpec `json:"params,omitempty"` // Workspaces declares a set of named workspaces that are expected to be // provided by a PipelineRun. // +optional // +listType=atomic Workspaces []PipelineWorkspaceDeclaration `json:"workspaces,omitempty"` // Results are values that this pipeline can output once run // +optional // +listType=atomic Results []PipelineResult `json:"results,omitempty"` // Finally declares the list of Tasks that execute just before leaving the Pipeline // i.e. either after all Tasks are finished executing successfully // or after a failure which would result in ending the Pipeline // +listType=atomic Finally []PipelineTask `json:"finally,omitempty"` }
PipelineSpec defines the desired state of Pipeline.
func (*PipelineSpec) DeepCopy ¶ added in v0.39.0
func (in *PipelineSpec) DeepCopy() *PipelineSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSpec.
func (*PipelineSpec) DeepCopyInto ¶ added in v0.39.0
func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PipelineSpec) SetDefaults ¶ added in v0.39.0
func (ps *PipelineSpec) SetDefaults(ctx context.Context)
SetDefaults sets default values for the PipelineSpec's Params, Tasks, and Finally
func (*PipelineSpec) Validate ¶ added in v0.39.0
func (ps *PipelineSpec) Validate(ctx context.Context) (errs *apis.FieldError)
Validate checks that taskNames in the Pipeline are valid and that the graph of Tasks expressed in the Pipeline makes sense.
type PipelineTask ¶ added in v0.39.0
type PipelineTask struct { // Name is the name of this task within the context of a Pipeline. Name is // used as a coordinate with the `from` and `runAfter` fields to establish // the execution order of tasks relative to one another. Name string `json:"name,omitempty"` // TaskRef is a reference to a task definition. // +optional TaskRef *TaskRef `json:"taskRef,omitempty"` // TaskSpec is a specification of a task // +optional TaskSpec *EmbeddedTask `json:"taskSpec,omitempty"` // When is a list of when expressions that need to be true for the task to run // +optional When WhenExpressions `json:"when,omitempty"` // Retries represents how many times this task should be retried in case of task failure: ConditionSucceeded set to False // +optional Retries int `json:"retries,omitempty"` // RunAfter is the list of PipelineTask names that should be executed before // this Task executes. (Used to force a specific ordering in graph execution.) // +optional // +listType=atomic RunAfter []string `json:"runAfter,omitempty"` // Parameters declares parameters passed to this task. // +optional // +listType=atomic Params []Param `json:"params,omitempty"` // Matrix declares parameters used to fan out this task. // +optional // +listType=atomic Matrix []Param `json:"matrix,omitempty"` // Workspaces maps workspaces from the pipeline spec to the workspaces // declared in the Task. // +optional // +listType=atomic Workspaces []WorkspacePipelineTaskBinding `json:"workspaces,omitempty"` // Time after which the TaskRun times out. Defaults to 1 hour. // Specified TaskRun timeout should be less than 24h. // Refer Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` }
PipelineTask defines a task in a Pipeline, passing inputs from both Params and from the output of previous tasks.
func (*PipelineTask) DeepCopy ¶ added in v0.39.0
func (in *PipelineTask) DeepCopy() *PipelineTask
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTask.
func (*PipelineTask) DeepCopyInto ¶ added in v0.39.0
func (in *PipelineTask) DeepCopyInto(out *PipelineTask)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (PipelineTask) Deps ¶ added in v0.39.0
func (pt PipelineTask) Deps() []string
Deps returns all other PipelineTask dependencies of this PipelineTask, based on ordering
func (*PipelineTask) GetMatrixCombinationsCount ¶ added in v0.39.0
func (pt *PipelineTask) GetMatrixCombinationsCount() int
GetMatrixCombinationsCount returns the count of combinations of Parameters generated from the Matrix in PipelineTask.
func (PipelineTask) HashKey ¶ added in v0.39.0
func (pt PipelineTask) HashKey() string
HashKey is the name of the PipelineTask, and is used as the key for this PipelineTask in the DAG
func (*PipelineTask) TaskSpecMetadata ¶ added in v0.39.0
func (pt *PipelineTask) TaskSpecMetadata() PipelineTaskMetadata
TaskSpecMetadata returns the metadata of the PipelineTask's EmbeddedTask spec.
func (PipelineTask) Validate ¶ added in v0.39.0
func (pt PipelineTask) Validate(ctx context.Context) (errs *apis.FieldError)
Validate classifies whether a task is a custom task or a regular task(dag/final) calls the validation routine based on the type of the task
func (PipelineTask) ValidateName ¶ added in v0.39.0
func (pt PipelineTask) ValidateName() *apis.FieldError
ValidateName checks whether the PipelineTask's name is a valid DNS label
type PipelineTaskList ¶ added in v0.39.0
type PipelineTaskList []PipelineTask
PipelineTaskList is a list of PipelineTasks
func (PipelineTaskList) DeepCopy ¶ added in v0.39.0
func (in PipelineTaskList) DeepCopy() PipelineTaskList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTaskList.
func (PipelineTaskList) DeepCopyInto ¶ added in v0.39.0
func (in PipelineTaskList) DeepCopyInto(out *PipelineTaskList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (PipelineTaskList) Deps ¶ added in v0.39.0
func (l PipelineTaskList) Deps() map[string][]string
Deps returns a map with key as name of a pipelineTask and value as a list of its dependencies
func (PipelineTaskList) Items ¶ added in v0.39.0
func (l PipelineTaskList) Items() []dag.Task
Items returns a slice of all tasks in the PipelineTaskList, converted to dag.Tasks
func (PipelineTaskList) Names ¶ added in v0.39.0
func (l PipelineTaskList) Names() sets.String
Names returns a set of pipeline task names from the given list of pipeline tasks
func (PipelineTaskList) Validate ¶ added in v0.39.0
func (l PipelineTaskList) Validate(ctx context.Context, taskNames sets.String, path string) (errs *apis.FieldError)
Validate a list of pipeline tasks including custom task
type PipelineTaskMetadata ¶ added in v0.39.0
type PipelineTaskMetadata struct { // +optional Labels map[string]string `json:"labels,omitempty"` // +optional Annotations map[string]string `json:"annotations,omitempty"` }
PipelineTaskMetadata contains the labels or annotations for an EmbeddedTask
func (*PipelineTaskMetadata) DeepCopy ¶ added in v0.39.0
func (in *PipelineTaskMetadata) DeepCopy() *PipelineTaskMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTaskMetadata.
func (*PipelineTaskMetadata) DeepCopyInto ¶ added in v0.39.0
func (in *PipelineTaskMetadata) DeepCopyInto(out *PipelineTaskMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PipelineTaskParam ¶ added in v0.39.0
PipelineTaskParam is used to provide arbitrary string parameters to a Task.
func (*PipelineTaskParam) DeepCopy ¶ added in v0.39.0
func (in *PipelineTaskParam) DeepCopy() *PipelineTaskParam
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTaskParam.
func (*PipelineTaskParam) DeepCopyInto ¶ added in v0.39.0
func (in *PipelineTaskParam) DeepCopyInto(out *PipelineTaskParam)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PipelineWorkspaceDeclaration ¶
type PipelineWorkspaceDeclaration struct { // Name is the name of a workspace to be provided by a PipelineRun. Name string `json:"name"` // Description is a human readable string describing how the workspace will be // used in the Pipeline. It can be useful to include a bit of detail about which // tasks are intended to have access to the data on the workspace. // +optional Description string `json:"description,omitempty"` // Optional marks a Workspace as not being required in PipelineRuns. By default // this field is false and so declared workspaces are required. Optional bool `json:"optional,omitempty"` }
PipelineWorkspaceDeclaration creates a named slot in a Pipeline that a PipelineRun is expected to populate with a workspace binding.
func (*PipelineWorkspaceDeclaration) DeepCopy ¶
func (in *PipelineWorkspaceDeclaration) DeepCopy() *PipelineWorkspaceDeclaration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineWorkspaceDeclaration.
func (*PipelineWorkspaceDeclaration) DeepCopyInto ¶
func (in *PipelineWorkspaceDeclaration) DeepCopyInto(out *PipelineWorkspaceDeclaration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PropertySpec ¶
type PropertySpec struct {
Type ParamType `json:"type,omitempty"`
}
PropertySpec defines the struct for object keys
func (*PropertySpec) DeepCopy ¶
func (in *PropertySpec) DeepCopy() *PropertySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PropertySpec.
func (*PropertySpec) DeepCopyInto ¶
func (in *PropertySpec) DeepCopyInto(out *PropertySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResolverName ¶
type ResolverName string
ResolverName is the name of a resolver from which a resource can be requested.
type ResolverParam ¶
type ResolverParam struct { // Name is the name of the parameter that will be passed to the // resolver. Name string `json:"name"` // Value is the string value of the parameter that will be // passed to the resolver. Value string `json:"value"` }
ResolverParam is a single parameter passed to a resolver.
func (*ResolverParam) DeepCopy ¶
func (in *ResolverParam) DeepCopy() *ResolverParam
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolverParam.
func (*ResolverParam) DeepCopyInto ¶
func (in *ResolverParam) DeepCopyInto(out *ResolverParam)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResolverRef ¶
type ResolverRef struct { // Resolver is the name of the resolver that should perform // resolution of the referenced Tekton resource, such as "git". // +optional Resolver ResolverName `json:"resolver,omitempty"` // Resource contains the parameters used to identify the // referenced Tekton resource. Example entries might include // "repo" or "path" but the set of params ultimately depends on // the chosen resolver. // +optional // +listType=atomic Resource []ResolverParam `json:"resource,omitempty"` }
ResolverRef can be used to refer to a Pipeline or Task in a remote location like a git repo. This feature is in alpha and these fields are only available when the alpha feature gate is enabled.
func (*ResolverRef) DeepCopy ¶
func (in *ResolverRef) DeepCopy() *ResolverRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResolverRef.
func (*ResolverRef) DeepCopyInto ¶
func (in *ResolverRef) DeepCopyInto(out *ResolverRef)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceParam ¶
type ResourceParam = resource.ResourceParam
ResourceParam declares a string value to use for the parameter called Name, and is used in the specific context of PipelineResources.
type ResultRef ¶ added in v0.39.0
type ResultRef struct { PipelineTask string `json:"pipelineTask"` Result string `json:"result"` ResultsIndex int `json:"resultsIndex"` Property string `json:"property"` }
ResultRef is a type that represents a reference to a task run result
func NewResultRefs ¶ added in v0.39.0
NewResultRefs extracts all ResultReferences from a param or a pipeline result. If the ResultReference can be extracted, they are returned. Expressions which are not results are ignored.
func PipelineTaskResultRefs ¶ added in v0.39.0
func PipelineTaskResultRefs(pt *PipelineTask) []*ResultRef
PipelineTaskResultRefs walks all the places a result reference can be used in a PipelineTask and returns a list of any references that are found.
func (*ResultRef) DeepCopy ¶ added in v0.39.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResultRef.
func (*ResultRef) DeepCopyInto ¶ added in v0.39.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResultValue ¶ added in v0.39.0
type ResultValue = ParamValue
ResultValue is a type alias of ParamValue
type ResultsType ¶
type ResultsType string
ResultsType indicates the type of a result; Used to distinguish between a single string and an array of strings. Note that there is ResultType used to find out whether a PipelineResourceResult is from a task result or not, which is different from this ResultsType.
const ( ResultsTypeString ResultsType = "string" ResultsTypeArray ResultsType = "array" ResultsTypeObject ResultsType = "object" )
Valid ResultsType:
type Sidecar ¶
type Sidecar struct { // Name of the Sidecar specified as a DNS_LABEL. // Each Sidecar in a Task must have a unique name (DNS_LABEL). // Cannot be updated. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Image reference name. // More info: https://kubernetes.io/docs/concepts/containers/images // This field is optional to allow higher level config management to default or override // container images in workload controllers like Deployments and StatefulSets. // +optional Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` // Entrypoint array. Not executed within a shell. // The image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the Sidecar's environment. If a variable // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional // +listType=atomic Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` // Arguments to the entrypoint. // The image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the Sidecar's environment. If a variable // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional // +listType=atomic Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` // Sidecar's working directory. // If not specified, the container runtime's default will be used, which // might be configured in the container image. // Cannot be updated. // +optional WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` // List of ports to expose from the Sidecar. Exposing a port here gives // the system additional information about the network connections a // container uses, but is primarily informational. Not specifying a port here // DOES NOT prevent that port from being exposed. Any port which is // listening on the default "0.0.0.0" address inside a container will be // accessible from the network. // Cannot be updated. // +optional // +patchMergeKey=containerPort // +patchStrategy=merge // +listType=map // +listMapKey=containerPort // +listMapKey=protocol Ports []corev1.ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"` // List of sources to populate environment variables in the Sidecar. // The keys defined within a source must be a C_IDENTIFIER. All invalid keys // will be reported as an event when the container is starting. When a key exists in multiple // sources, the value associated with the last source will take precedence. // Values defined by an Env with a duplicate key will take precedence. // Cannot be updated. // +optional // +listType=atomic EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` // List of environment variables to set in the Sidecar. // Cannot be updated. // +optional // +patchMergeKey=name // +patchStrategy=merge // +listType=atomic Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` // Compute Resources required by this Sidecar. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` // Volumes to mount into the Sidecar's filesystem. // Cannot be updated. // +optional // +patchMergeKey=mountPath // +patchStrategy=merge // +listType=atomic VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` // volumeDevices is the list of block devices to be used by the Sidecar. // +patchMergeKey=devicePath // +patchStrategy=merge // +optional // +listType=atomic VolumeDevices []corev1.VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"` // Periodic probe of Sidecar liveness. // Container will be restarted if the probe fails. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // +optional LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"` // Periodic probe of Sidecar service readiness. // Container will be removed from service endpoints if the probe fails. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // +optional ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"` // StartupProbe indicates that the Pod the Sidecar is running in has successfully initialized. // If specified, no other probes are executed until this completes successfully. // If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. // This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, // when it might take a long time to load data or warm a cache, than during steady-state operation. // This cannot be updated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes // +optional StartupProbe *corev1.Probe `json:"startupProbe,omitempty" protobuf:"bytes,22,opt,name=startupProbe"` // Actions that the management system should take in response to Sidecar lifecycle events. // Cannot be updated. // +optional Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` // Optional: Path at which the file to which the Sidecar's termination message // will be written is mounted into the Sidecar's filesystem. // Message written is intended to be brief final status, such as an assertion failure message. // Will be truncated by the node if greater than 4096 bytes. The total message length across // all containers will be limited to 12kb. // Defaults to /dev/termination-log. // Cannot be updated. // +optional TerminationMessagePath string `json:"terminationMessagePath,omitempty" protobuf:"bytes,13,opt,name=terminationMessagePath"` // Indicate how the termination message should be populated. File will use the contents of // terminationMessagePath to populate the Sidecar status message on both success and failure. // FallbackToLogsOnError will use the last chunk of Sidecar log output if the termination // message file is empty and the Sidecar exited with an error. // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. // Defaults to File. // Cannot be updated. // +optional TerminationMessagePolicy corev1.TerminationMessagePolicy `` /* 129-byte string literal not displayed */ // Image pull policy. // One of Always, Never, IfNotPresent. // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images // +optional ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` // SecurityContext defines the security options the Sidecar should be run with. // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` // Whether this Sidecar should allocate a buffer for stdin in the container runtime. If this // is not set, reads from stdin in the Sidecar will always result in EOF. // Default is false. // +optional Stdin bool `json:"stdin,omitempty" protobuf:"varint,16,opt,name=stdin"` // Whether the container runtime should close the stdin channel after it has been opened by // a single attach. When stdin is true the stdin stream will remain open across multiple attach // sessions. If stdinOnce is set to true, stdin is opened on Sidecar start, is empty until the // first client attaches to stdin, and then remains open and accepts data until the client disconnects, // at which time stdin is closed and remains closed until the Sidecar is restarted. If this // flag is false, a container processes that reads from stdin will never receive an EOF. // Default is false // +optional StdinOnce bool `json:"stdinOnce,omitempty" protobuf:"varint,17,opt,name=stdinOnce"` // Whether this Sidecar should allocate a TTY for itself, also requires 'stdin' to be true. // Default is false. // +optional TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"` // Script is the contents of an executable file to execute. // // If Script is not empty, the Step cannot have an Command or Args. // +optional Script string `json:"script,omitempty"` // This is an alpha field. You must set the "enable-api-fields" feature flag to "alpha" // for this field to be supported. // // Workspaces is a list of workspaces from the Task that this Sidecar wants // exclusive access to. Adding a workspace to this list means that any // other Step or Sidecar that does not also request this Workspace will // not have access to it. // +optional // +listType=atomic Workspaces []WorkspaceUsage `json:"workspaces,omitempty"` }
Sidecar has nearly the same data structure as Step but does not have the ability to timeout.
func (*Sidecar) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sidecar.
func (*Sidecar) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Sidecar) SetContainerFields ¶
SetContainerFields sets the fields of the Sidecar to the values of the corresponding fields in the Container
func (*Sidecar) ToK8sContainer ¶
ToK8sContainer converts the Sidecar to a Kubernetes Container struct
type Step ¶
type Step struct { // Name of the Step specified as a DNS_LABEL. // Each Step in a Task must have a unique name. Name string `json:"name" protobuf:"bytes,1,opt,name=name"` // Docker image name. // More info: https://kubernetes.io/docs/concepts/containers/images // +optional Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` // Entrypoint array. Not executed within a shell. // The image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional // +listType=atomic Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` // Arguments to the entrypoint. // The image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional // +listType=atomic Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` // Step's working directory. // If not specified, the container runtime's default will be used, which // might be configured in the container image. // Cannot be updated. // +optional WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` // List of sources to populate environment variables in the Step. // The keys defined within a source must be a C_IDENTIFIER. All invalid keys // will be reported as an event when the Step is starting. When a key exists in multiple // sources, the value associated with the last source will take precedence. // Values defined by an Env with a duplicate key will take precedence. // Cannot be updated. // +optional // +listType=atomic EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` // List of environment variables to set in the Step. // Cannot be updated. // +optional // +patchMergeKey=name // +patchStrategy=merge // +listType=atomic Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` // Compute Resources required by this Step. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` // Volumes to mount into the Step's filesystem. // Cannot be updated. // +optional // +patchMergeKey=mountPath // +patchStrategy=merge // +listType=atomic VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` // volumeDevices is the list of block devices to be used by the Step. // +patchMergeKey=devicePath // +patchStrategy=merge // +optional // +listType=atomic VolumeDevices []corev1.VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"` // Image pull policy. // One of Always, Never, IfNotPresent. // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images // +optional ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` // SecurityContext defines the security options the Step should be run with. // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` // Script is the contents of an executable file to execute. // // If Script is not empty, the Step cannot have an Command and the Args will be passed to the Script. // +optional Script string `json:"script,omitempty"` // Timeout is the time after which the step times out. Defaults to never. // Refer to Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` // This is an alpha field. You must set the "enable-api-fields" feature flag to "alpha" // for this field to be supported. // // Workspaces is a list of workspaces from the Task that this Step wants // exclusive access to. Adding a workspace to this list means that any // other Step or Sidecar that does not also request this Workspace will // not have access to it. // +optional // +listType=atomic Workspaces []WorkspaceUsage `json:"workspaces,omitempty"` // OnError defines the exiting behavior of a container on error // can be set to [ continue | stopAndFail ] OnError OnErrorType `json:"onError,omitempty"` // Stores configuration for the stdout stream of the step. // +optional StdoutConfig *StepOutputConfig `json:"stdoutConfig,omitempty"` // Stores configuration for the stderr stream of the step. // +optional StderrConfig *StepOutputConfig `json:"stderrConfig,omitempty"` }
Step runs a subcomponent of a Task
func MergeStepsWithStepTemplate ¶
func MergeStepsWithStepTemplate(template *StepTemplate, steps []Step) ([]Step, error)
MergeStepsWithStepTemplate takes a possibly nil container template and a list of steps, merging each of the steps with the container template, if it's not nil, and returning the resulting list.
func (*Step) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step.
func (*Step) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Step) SetContainerFields ¶
SetContainerFields sets the fields of the Step to the values of the corresponding fields in the Container
func (*Step) ToK8sContainer ¶
ToK8sContainer converts the Step to a Kubernetes Container struct
type StepOutputConfig ¶
type StepOutputConfig struct { // Path to duplicate stdout stream to on container's local filesystem. // +optional Path string `json:"path,omitempty"` }
StepOutputConfig stores configuration for a step output stream.
func (*StepOutputConfig) DeepCopy ¶
func (in *StepOutputConfig) DeepCopy() *StepOutputConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepOutputConfig.
func (*StepOutputConfig) DeepCopyInto ¶
func (in *StepOutputConfig) DeepCopyInto(out *StepOutputConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StepTemplate ¶
type StepTemplate struct { // Image reference name. // More info: https://kubernetes.io/docs/concepts/containers/images // This field is optional to allow higher level config management to default or override // container images in workload controllers like Deployments and StatefulSets. // +optional Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` // Entrypoint array. Not executed within a shell. // The image's ENTRYPOINT is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the Step's environment. If a variable // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional // +listType=atomic Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` // Arguments to the entrypoint. // The image's CMD is used if this is not provided. // Variable references $(VAR_NAME) are expanded using the Step's environment. If a variable // cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced // to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will // produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless // of whether the variable exists or not. Cannot be updated. // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell // +optional // +listType=atomic Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` // Step's working directory. // If not specified, the container runtime's default will be used, which // might be configured in the container image. // Cannot be updated. // +optional WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` // List of sources to populate environment variables in the Step. // The keys defined within a source must be a C_IDENTIFIER. All invalid keys // will be reported as an event when the Step is starting. When a key exists in multiple // sources, the value associated with the last source will take precedence. // Values defined by an Env with a duplicate key will take precedence. // Cannot be updated. // +optional // +listType=atomic EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` // List of environment variables to set in the Step. // Cannot be updated. // +optional // +patchMergeKey=name // +patchStrategy=merge // +listType=atomic Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` // Compute Resources required by this Step. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ // +optional Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` // Volumes to mount into the Step's filesystem. // Cannot be updated. // +optional // +patchMergeKey=mountPath // +patchStrategy=merge // +listType=atomic VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` // volumeDevices is the list of block devices to be used by the Step. // +patchMergeKey=devicePath // +patchStrategy=merge // +optional // +listType=atomic VolumeDevices []corev1.VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"` // Image pull policy. // One of Always, Never, IfNotPresent. // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images // +optional ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` // SecurityContext defines the security options the Step should be run with. // If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ // +optional SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` }
StepTemplate is a template for a Step
func (*StepTemplate) DeepCopy ¶
func (in *StepTemplate) DeepCopy() *StepTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepTemplate.
func (*StepTemplate) DeepCopyInto ¶
func (in *StepTemplate) DeepCopyInto(out *StepTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*StepTemplate) SetContainerFields ¶
func (s *StepTemplate) SetContainerFields(c corev1.Container)
SetContainerFields sets the fields of the Step to the values of the corresponding fields in the Container
func (*StepTemplate) ToK8sContainer ¶
func (s *StepTemplate) ToK8sContainer() *corev1.Container
ToK8sContainer converts the StepTemplate to a Kubernetes Container struct
type Task ¶
type Task struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ObjectMeta `json:"metadata"` // Spec holds the desired state of the Task from the client // +optional Spec TaskSpec `json:"spec"` }
Task represents a collection of sequential steps that are run as part of a Pipeline using a set of inputs and producing a set of outputs. Tasks execute when TaskRuns are created that provide the input parameters and resources and output resources the Task requires.
+k8s:openapi-gen=true
func (*Task) ConvertFrom ¶ added in v0.39.0
ConvertFrom implements apis.Convertible
func (*Task) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Task.
func (*Task) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Task) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Task) GetGroupVersionKind ¶
func (*Task) GetGroupVersionKind() schema.GroupVersionKind
GetGroupVersionKind implements kmeta.OwnerRefable.
func (*Task) SetDefaults ¶
SetDefaults implements apis.Defaultable
type TaskKind ¶ added in v0.39.0
type TaskKind string
TaskKind defines the type of Task used by the pipeline.
const ( // NamespacedTaskKind indicates that the task type has a namespaced scope. NamespacedTaskKind TaskKind = "Task" )
type TaskList ¶
type TaskList struct { metav1.TypeMeta `json:",inline"` // +optional metav1.ListMeta `json:"metadata,omitempty"` Items []Task `json:"items"` }
TaskList contains a list of Task +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*TaskList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskList.
func (*TaskList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TaskList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TaskRef ¶ added in v0.39.0
type TaskRef struct { // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names Name string `json:"name,omitempty"` // TaskKind indicates the kind of the task, namespaced or cluster scoped. Kind TaskKind `json:"kind,omitempty"` // API version of the referent // +optional APIVersion string `json:"apiVersion,omitempty"` // ResolverRef allows referencing a Task in a remote location // like a git repo. This field is only supported when the alpha // feature gate is enabled. // +optional ResolverRef `json:",omitempty"` }
TaskRef can be used to refer to a specific instance of a task.
func (*TaskRef) DeepCopy ¶ added in v0.39.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskRef.
func (*TaskRef) DeepCopyInto ¶ added in v0.39.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TaskResult ¶
type TaskResult struct { // Name the given name Name string `json:"name"` // Type is the user-specified type of the result. The possible type // is currently "string" and will support "array" in following work. // +optional Type ResultsType `json:"type,omitempty"` // Properties is the JSON Schema properties to support key-value pairs results. // +optional Properties map[string]PropertySpec `json:"properties,omitempty"` // Description is a human-readable description of the result // +optional Description string `json:"description,omitempty"` }
TaskResult used to describe the results of a task
func (*TaskResult) DeepCopy ¶
func (in *TaskResult) DeepCopy() *TaskResult
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskResult.
func (*TaskResult) DeepCopyInto ¶
func (in *TaskResult) DeepCopyInto(out *TaskResult)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TaskResult) SetDefaults ¶
func (tr *TaskResult) SetDefaults(context.Context)
SetDefaults set the default type for TaskResult
func (TaskResult) Validate ¶
func (tr TaskResult) Validate(ctx context.Context) (errs *apis.FieldError)
Validate implements apis.Validatable
type TaskRunResult ¶
type TaskRunResult struct { // Name the given name Name string `json:"name"` // Type is the user-specified type of the result. The possible type // is currently "string" and will support "array" in following work. // +optional Type ResultsType `json:"type,omitempty"` // Value the given value of the result Value ResultValue `json:"value"` }
TaskRunResult used to describe the results of a task
func (*TaskRunResult) DeepCopy ¶
func (in *TaskRunResult) DeepCopy() *TaskRunResult
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskRunResult.
func (*TaskRunResult) DeepCopyInto ¶
func (in *TaskRunResult) DeepCopyInto(out *TaskRunResult)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TaskSpec ¶
type TaskSpec struct { // Params is a list of input parameters required to run the task. Params // must be supplied as inputs in TaskRuns unless they declare a default // value. // +optional // +listType=atomic Params []ParamSpec `json:"params,omitempty"` // Description is a user-facing description of the task that may be // used to populate a UI. // +optional Description string `json:"description,omitempty"` // Steps are the steps of the build; each step is run sequentially with the // source mounted into /workspace. // +listType=atomic Steps []Step `json:"steps,omitempty"` // Volumes is a collection of volumes that are available to mount into the // steps of the build. // +listType=atomic Volumes []corev1.Volume `json:"volumes,omitempty"` // StepTemplate can be used as the basis for all step containers within the // Task, so that the steps inherit settings on the base container. StepTemplate *StepTemplate `json:"stepTemplate,omitempty"` // Sidecars are run alongside the Task's step containers. They begin before // the steps start and end after the steps complete. // +listType=atomic Sidecars []Sidecar `json:"sidecars,omitempty"` // Workspaces are the volumes that this Task requires. // +listType=atomic Workspaces []WorkspaceDeclaration `json:"workspaces,omitempty"` // Results are values that this Task can output // +listType=atomic Results []TaskResult `json:"results,omitempty"` }
TaskSpec defines the desired state of Task.
func (*TaskSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskSpec.
func (*TaskSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TaskSpec) SetDefaults ¶
SetDefaults set any defaults for the task spec
type WhenExpression ¶ added in v0.39.0
type WhenExpression struct { // Input is the string for guard checking which can be a static input or an output from a parent Task Input string `json:"input"` // Operator that represents an Input's relationship to the values Operator selection.Operator `json:"operator"` // Values is an array of strings, which is compared against the input, for guard checking // It must be non-empty // +listType=atomic Values []string `json:"values"` }
WhenExpression allows a PipelineTask to declare expressions to be evaluated before the Task is run to determine whether the Task should be executed or skipped
func (*WhenExpression) DeepCopy ¶ added in v0.39.0
func (in *WhenExpression) DeepCopy() *WhenExpression
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WhenExpression.
func (*WhenExpression) DeepCopyInto ¶ added in v0.39.0
func (in *WhenExpression) DeepCopyInto(out *WhenExpression)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WhenExpression) GetVarSubstitutionExpressions ¶ added in v0.39.0
func (we *WhenExpression) GetVarSubstitutionExpressions() ([]string, bool)
GetVarSubstitutionExpressions extracts all the values between "$(" and ")" in a When Expression
type WhenExpressions ¶ added in v0.39.0
type WhenExpressions []WhenExpression
WhenExpressions are used to specify whether a Task should be executed or skipped All of them need to evaluate to True for a guarded Task to be executed.
func (WhenExpressions) AllowsExecution ¶ added in v0.39.0
func (wes WhenExpressions) AllowsExecution() bool
AllowsExecution evaluates an Input's relationship to an array of Values, based on the Operator, to determine whether all the When Expressions are True. If they are all True, the guarded Task is executed, otherwise it is skipped.
func (WhenExpressions) DeepCopy ¶ added in v0.39.0
func (in WhenExpressions) DeepCopy() WhenExpressions
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WhenExpressions.
func (WhenExpressions) DeepCopyInto ¶ added in v0.39.0
func (in WhenExpressions) DeepCopyInto(out *WhenExpressions)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (WhenExpressions) ReplaceWhenExpressionsVariables ¶ added in v0.39.0
func (wes WhenExpressions) ReplaceWhenExpressionsVariables(replacements map[string]string, arrayReplacements map[string][]string) WhenExpressions
ReplaceWhenExpressionsVariables interpolates variables, such as Parameters and Results, in the Input and Values.
type WorkspaceBinding ¶
type WorkspaceBinding struct { // Name is the name of the workspace populated by the volume. Name string `json:"name"` // SubPath is optionally a directory on the volume which should be used // for this binding (i.e. the volume will be mounted at this sub directory). // +optional SubPath string `json:"subPath,omitempty"` // VolumeClaimTemplate is a template for a claim that will be created in the same namespace. // The PipelineRun controller is responsible for creating a unique claim for each instance of PipelineRun. // +optional VolumeClaimTemplate *corev1.PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"` // PersistentVolumeClaimVolumeSource represents a reference to a // PersistentVolumeClaim in the same namespace. Either this OR EmptyDir can be used. // +optional PersistentVolumeClaim *corev1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` // EmptyDir represents a temporary directory that shares a Task's lifetime. // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir // Either this OR PersistentVolumeClaim can be used. // +optional EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"` // ConfigMap represents a configMap that should populate this workspace. // +optional ConfigMap *corev1.ConfigMapVolumeSource `json:"configMap,omitempty"` // Secret represents a secret that should populate this workspace. // +optional Secret *corev1.SecretVolumeSource `json:"secret,omitempty"` }
WorkspaceBinding maps a Task's declared workspace to a Volume.
func (*WorkspaceBinding) DeepCopy ¶
func (in *WorkspaceBinding) DeepCopy() *WorkspaceBinding
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceBinding.
func (*WorkspaceBinding) DeepCopyInto ¶
func (in *WorkspaceBinding) DeepCopyInto(out *WorkspaceBinding)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WorkspaceBinding) Validate ¶
func (b *WorkspaceBinding) Validate(context.Context) *apis.FieldError
Validate looks at the Volume provided in wb and makes sure that it is valid. This means that only one VolumeSource can be specified, and also that the supported VolumeSource is itself valid.
type WorkspaceDeclaration ¶
type WorkspaceDeclaration struct { // Name is the name by which you can bind the volume at runtime. Name string `json:"name"` // Description is an optional human readable description of this volume. // +optional Description string `json:"description,omitempty"` // MountPath overrides the directory that the volume will be made available at. // +optional MountPath string `json:"mountPath,omitempty"` // ReadOnly dictates whether a mounted volume is writable. By default this // field is false and so mounted volumes are writable. ReadOnly bool `json:"readOnly,omitempty"` // Optional marks a Workspace as not being required in TaskRuns. By default // this field is false and so declared workspaces are required. Optional bool `json:"optional,omitempty"` }
WorkspaceDeclaration is a declaration of a volume that a Task requires.
func (*WorkspaceDeclaration) DeepCopy ¶
func (in *WorkspaceDeclaration) DeepCopy() *WorkspaceDeclaration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceDeclaration.
func (*WorkspaceDeclaration) DeepCopyInto ¶
func (in *WorkspaceDeclaration) DeepCopyInto(out *WorkspaceDeclaration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*WorkspaceDeclaration) GetMountPath ¶
func (w *WorkspaceDeclaration) GetMountPath() string
GetMountPath returns the mountPath for w which is the MountPath if provided or the default if not.
type WorkspacePipelineDeclaration ¶
type WorkspacePipelineDeclaration = PipelineWorkspaceDeclaration
WorkspacePipelineDeclaration creates a named slot in a Pipeline that a PipelineRun is expected to populate with a workspace binding. Deprecated: use PipelineWorkspaceDeclaration type instead
type WorkspacePipelineTaskBinding ¶
type WorkspacePipelineTaskBinding struct { // Name is the name of the workspace as declared by the task Name string `json:"name"` // Workspace is the name of the workspace declared by the pipeline // +optional Workspace string `json:"workspace,omitempty"` // SubPath is optionally a directory on the volume which should be used // for this binding (i.e. the volume will be mounted at this sub directory). // +optional SubPath string `json:"subPath,omitempty"` }
WorkspacePipelineTaskBinding describes how a workspace passed into the pipeline should be mapped to a task's declared workspace.
func (*WorkspacePipelineTaskBinding) DeepCopy ¶
func (in *WorkspacePipelineTaskBinding) DeepCopy() *WorkspacePipelineTaskBinding
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspacePipelineTaskBinding.
func (*WorkspacePipelineTaskBinding) DeepCopyInto ¶
func (in *WorkspacePipelineTaskBinding) DeepCopyInto(out *WorkspacePipelineTaskBinding)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WorkspaceUsage ¶
type WorkspaceUsage struct { // Name is the name of the workspace this Step or Sidecar wants access to. Name string `json:"name"` // MountPath is the path that the workspace should be mounted to inside the Step or Sidecar, // overriding any MountPath specified in the Task's WorkspaceDeclaration. MountPath string `json:"mountPath"` }
WorkspaceUsage is used by a Step or Sidecar to declare that it wants isolated access to a Workspace defined in a Task.
func (*WorkspaceUsage) DeepCopy ¶
func (in *WorkspaceUsage) DeepCopy() *WorkspaceUsage
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceUsage.
func (*WorkspaceUsage) DeepCopyInto ¶
func (in *WorkspaceUsage) DeepCopyInto(out *WorkspaceUsage)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Source Files ¶
- container_types.go
- doc.go
- merge.go
- openapi_generated.go
- param_types.go
- pipeline_conversion.go
- pipeline_defaults.go
- pipeline_types.go
- pipeline_validation.go
- register.go
- resolver_types.go
- result_defaults.go
- result_types.go
- result_validation.go
- resultref.go
- status_validation.go
- task_conversion.go
- task_defaults.go
- task_types.go
- task_validation.go
- taskref_types.go
- taskref_validation.go
- when_types.go
- when_validation.go
- workspace_types.go
- workspace_validation.go
- zz_generated.deepcopy.go