WorkspaceBinding maps a Task’s declared workspace to a Volume.
RunStatus defines the observed state of Run
diff --git a/docs/pipeline-api.md.backup b/docs/pipeline-api.md.backup
new file mode 100644
index 00000000000..a3977d6a34a
--- /dev/null
+++ b/docs/pipeline-api.md.backup
@@ -0,0 +1,12991 @@
+
Packages:
+
+
resolution.tekton.dev/v1alpha1
+
+
+Resource Types:
+
+
ResolutionRequest
+
+
+
ResolutionRequest is an object for requesting the content of
+a Tekton resource like a pipeline.yaml.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+ResolutionRequestSpec
+
+
+ |
+
+(Optional)
+ Spec holds the information for the request part of the resource request.
+
+
+
+
+
+params
+
+map[string]string
+
+ |
+
+(Optional)
+ Parameters are the runtime attributes passed to
+the resolver to help it figure out how to resolve the
+resource being requested. For example: repo URL, commit SHA,
+path to file, the kind of authentication to leverage, etc.
+ |
+
+
+ |
+
+
+
+status
+
+
+ResolutionRequestStatus
+
+
+ |
+
+(Optional)
+ Status communicates the state of the request and, ultimately,
+the content of the resolved resource.
+ |
+
+
+
+
ResolutionRequestSpec
+
+
+(Appears on:ResolutionRequest)
+
+
+
ResolutionRequestSpec are all the fields in the spec of the
+ResolutionRequest CRD.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+params
+
+map[string]string
+
+ |
+
+(Optional)
+ Parameters are the runtime attributes passed to
+the resolver to help it figure out how to resolve the
+resource being requested. For example: repo URL, commit SHA,
+path to file, the kind of authentication to leverage, etc.
+ |
+
+
+
+
ResolutionRequestStatus
+
+
+(Appears on:ResolutionRequest)
+
+
+
ResolutionRequestStatus are all the fields in a ResolutionRequest’s
+status subresource.
+
+
+
ResolutionRequestStatusFields
+
+
+(Appears on:ResolutionRequestStatus)
+
+
+
ResolutionRequestStatusFields are the ResolutionRequest-specific fields
+for the status subresource.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+data
+
+string
+
+ |
+
+ Data is a string representation of the resolved content
+of the requested resource in-lined into the ResolutionRequest
+object.
+ |
+
+
+
+
+
tekton.dev/v1
+
+
Package v1 contains API Schema definitions for the pipeline v1 API group
+
+Resource Types:
+
+
Pipeline
+
+
+
Pipeline describes a list of Tasks to execute. It expresses how outputs
+of tasks feed into inputs of subsequent tasks.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1
+
+ |
+
+
+
+kind
+string
+ |
+Pipeline |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+PipelineSpec
+
+
+ |
+
+(Optional)
+ Spec holds the desired state of the Pipeline from the client
+
+
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the pipeline that may be
+used to populate a UI.
+ |
+
+
+
+tasks
+
+
+[]PipelineTask
+
+
+ |
+
+ Tasks declares the graph of Tasks that execute when this Pipeline is run.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+ Params declares a list of input parameters that must be supplied when
+this Pipeline is run.
+ |
+
+
+
+workspaces
+
+
+[]PipelineWorkspaceDeclaration
+
+
+ |
+
+(Optional)
+ Workspaces declares a set of named workspaces that are expected to be
+provided by a PipelineRun.
+ |
+
+
+
+results
+
+
+[]PipelineResult
+
+
+ |
+
+(Optional)
+ Results are values that this pipeline can output once run
+ |
+
+
+
+finally
+
+
+[]PipelineTask
+
+
+ |
+
+ 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
+ |
+
+
+ |
+
+
+
+
PipelineRun
+
+
+
PipelineRun represents a single execution of a Pipeline. PipelineRuns are how
+the graph of Tasks declared in a Pipeline are executed; they specify inputs
+to Pipelines such as parameter values and capture operational aspects of the
+Tasks execution such as service account and tolerations. Creating a
+PipelineRun creates TaskRuns for Tasks in the referenced Pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1
+
+ |
+
+
+
+kind
+string
+ |
+PipelineRun |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+PipelineRunSpec
+
+
+ |
+
+(Optional)
+
+
+
+
+
+pipelineRef
+
+
+PipelineRef
+
+
+ |
+
+(Optional)
+ |
+
+
+
+pipelineSpec
+
+
+PipelineSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+ Params is a list of parameter names and values.
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+PipelineRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a pipelinerun (and maybe more later on)
+ |
+
+
+
+timeouts
+
+
+TimeoutFields
+
+
+ |
+
+(Optional)
+ Time after which the Pipeline times out.
+Currently three keys are accepted in the map
+pipeline, tasks and finally
+with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces holds a set of workspace bindings that must match names
+with those declared in the pipeline.
+ |
+
+
+
+taskRunSpecs
+
+
+[]PipelineTaskRunSpec
+
+
+ |
+
+(Optional)
+ TaskRunSpecs holds a set of runtime specs
+ |
+
+
+ |
+
+
+
+status
+
+
+PipelineRunStatus
+
+
+ |
+
+(Optional)
+ |
+
+
+
+
Task
+
+
+
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.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1
+
+ |
+
+
+
+kind
+string
+ |
+Task |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ Spec holds the desired state of the Task from the client
+
+
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the task that may be
+used to populate a UI.
+ |
+
+
+
+steps
+
+
+[]Step
+
+
+ |
+
+ Steps are the steps of the build; each step is run sequentially with the
+source mounted into /workspace.
+ |
+
+
+
+volumes
+
+
+[]Kubernetes core/v1.Volume
+
+
+ |
+
+ Volumes is a collection of volumes that are available to mount into the
+steps of the build.
+ |
+
+
+
+stepTemplate
+
+
+StepTemplate
+
+
+ |
+
+ StepTemplate can be used as the basis for all step containers within the
+Task, so that the steps inherit settings on the base container.
+ |
+
+
+
+sidecars
+
+
+[]Sidecar
+
+
+ |
+
+ Sidecars are run alongside the Task’s step containers. They begin before
+the steps start and end after the steps complete.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceDeclaration
+
+
+ |
+
+ Workspaces are the volumes that this Task requires.
+ |
+
+
+
+results
+
+
+[]TaskResult
+
+
+ |
+
+ Results are values that this Task can output
+ |
+
+
+ |
+
+
+
+
TaskRun
+
+
+
TaskRun represents a single execution of a Task. TaskRuns are how the steps
+specified in a Task are executed; they specify the parameters and resources
+used to run the steps in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1
+
+ |
+
+
+
+kind
+string
+ |
+TaskRun |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+TaskRunSpec
+
+
+ |
+
+(Optional)
+
+
+
+
+
+debug
+
+
+TaskRunDebug
+
+
+ |
+
+(Optional)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+taskRef
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ no more than one of the TaskRef and TaskSpec may be specified.
+ |
+
+
+
+taskSpec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+TaskRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a taskrun (and maybe more later on)
+ |
+
+
+
+statusMessage
+
+
+TaskRunSpecStatusMessage
+
+
+ |
+
+(Optional)
+ Status message for cancellation.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Time after which the build times out. Defaults to 1 hour.
+Specified build timeout should be less than 24h.
+Refer Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces is a list of WorkspaceBindings from volumes to workspaces.
+ |
+
+
+
+stepOverrides
+
+
+[]TaskRunStepOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Steps in this TaskRun.
+If a field is specified in both a Step and a StepOverride,
+the value from the StepOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+sidecarOverrides
+
+
+[]TaskRunSidecarOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Sidecars in this TaskRun.
+If a field is specified in both a Sidecar and a SidecarOverride,
+the value from the SidecarOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+computeResources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ Compute resources to use for this TaskRun
+ |
+
+
+ |
+
+
+
+status
+
+
+TaskRunStatus
+
+
+ |
+
+(Optional)
+ |
+
+
+
+
ChildStatusReference
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
ChildStatusReference is used to point to the statuses of individual TaskRuns and Runs within this PipelineRun.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the TaskRun or Run this is referencing.
+ |
+
+
+
+pipelineTaskName
+
+string
+
+ |
+
+ PipelineTaskName is the name of the PipelineTask this is referencing.
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
EmbeddedTask
+
+
+(Appears on:PipelineTask)
+
+
+
EmbeddedTask is used to define a Task inline within a Pipeline’s PipelineTasks.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+spec
+
+k8s.io/apimachinery/pkg/runtime.RawExtension
+
+ |
+
+(Optional)
+ Spec is a specification of a custom task
+
+
+
+
+
+-
+
+[]byte
+
+ |
+
+ Raw is the underlying serialization of this object.
+TODO: Determine how to detect ContentType and ContentEncoding of ‘Raw’ data.
+ |
+
+
+
+-
+
+k8s.io/apimachinery/pkg/runtime.Object
+
+ |
+
+ Object can hold a representation of this extension - useful for working with versioned
+structs.
+ |
+
+
+ |
+
+
+
+metadata
+
+
+PipelineTaskMetadata
+
+
+ |
+
+(Optional)
+ |
+
+
+
+TaskSpec
+
+
+TaskSpec
+
+
+ |
+
+
+(Members of TaskSpec are embedded into this type.)
+
+(Optional)
+TaskSpec is a specification of a task
+ |
+
+
+
+
OnErrorType
+(string
alias)
+
+(Appears on:Step)
+
+
+
OnErrorType defines a list of supported exiting behavior of a container on error
+
+
+
+
+Value |
+Description |
+
+
+"continue" |
+Continue indicates continue executing the rest of the steps irrespective of the container exit code
+ |
+
"stopAndFail" |
+StopAndFail indicates exit the taskRun if the container exits with non-zero exit code
+ |
+
+
+
Param
+
+
+(Appears on:PipelineRunSpec, PipelineTask, ResolverRef, TaskRunInputs, TaskRunSpec)
+
+
+
Param declares an ParamValues to use for the parameter called name.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ |
+
+
+
+
ParamSpec
+
+
+(Appears on:PipelineSpec, TaskSpec)
+
+
+
ParamSpec defines arbitrary parameters needed beyond typed inputs (such as
+resources). Parameter values are provided by users as inputs on a TaskRun
+or PipelineRun.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name declares the name by which a parameter is referenced.
+ |
+
+
+
+type
+
+
+ParamType
+
+
+ |
+
+(Optional)
+ Type is the user-specified type of the parameter. The possible types
+are currently “string”, “array” and “object”, and “string” is the default.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the parameter that may be
+used to populate a UI.
+ |
+
+
+
+properties
+
+
+map[string]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PropertySpec
+
+
+ |
+
+(Optional)
+ Properties is the JSON Schema properties to support key-value pairs parameter.
+ |
+
+
+
+default
+
+
+ParamValue
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+
ParamType
+(string
alias)
+
+(Appears on:ParamSpec, ParamValue, PropertySpec)
+
+
+
ParamType indicates the type of an input parameter;
+Used to distinguish between a single string and an array of strings.
+
+
+
+
+Value |
+Description |
+
+
+"array" |
+ |
+
"object" |
+ |
+
"string" |
+ |
+
+
+
ParamValue
+
+
+(Appears on:Param, ParamSpec, PipelineResult, PipelineRunResult, TaskRunResult)
+
+
+
ResultValue is a type alias of ParamValue
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+type
+
+
+ParamType
+
+
+ |
+
+ |
+
+
+
+stringVal
+
+string
+
+ |
+
+ Represents the stored type of ParamValues.
+ |
+
+
+
+arrayVal
+
+[]string
+
+ |
+
+ |
+
+
+
+objectVal
+
+map[string]string
+
+ |
+
+ |
+
+
+
+
PipelineRef
+
+
+(Appears on:PipelineRunSpec)
+
+
+
PipelineRef can be used to refer to a specific instance of a Pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ |
+
+
+
+apiVersion
+
+string
+
+ |
+
+(Optional)
+ API version of the referent
+ |
+
+
+
+ResolverRef
+
+
+ResolverRef
+
+
+ |
+
+(Optional)
+ ResolverRef allows referencing a Pipeline in a remote location
+like a git repo. This field is only supported when the alpha
+feature gate is enabled.
+ |
+
+
+
+
PipelineResult
+
+
+(Appears on:PipelineSpec)
+
+
+
PipelineResult used to describe the results of a pipeline
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+type
+
+
+ResultsType
+
+
+ |
+
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a human-readable description of the result
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ Value the expression used to retrieve the value
+ |
+
+
+
+
PipelineRunReason
+(string
alias)
+
+
PipelineRunReason represents a reason for the pipeline run “Succeeded” condition
+
+
+
+
+Value |
+Description |
+
+
+"Cancelled" |
+PipelineRunReasonCancelled is the reason set when the PipelineRun cancelled by the user
+This reason may be found with a corev1.ConditionFalse status, if the cancellation was processed successfully
+This reason may be found with a corev1.ConditionUnknown status, if the cancellation is being processed or failed
+ |
+
"CancelledRunningFinally" |
+PipelineRunReasonCancelledRunningFinally indicates that pipeline has been gracefully cancelled
+and no new Tasks will be scheduled by the controller, but final tasks are now running
+ |
+
"Completed" |
+PipelineRunReasonCompleted is the reason set when the PipelineRun completed successfully with one or more skipped Tasks
+ |
+
"Failed" |
+PipelineRunReasonFailed is the reason set when the PipelineRun completed with a failure
+ |
+
"PipelineRunPending" |
+PipelineRunReasonPending is the reason set when the PipelineRun is in the pending state
+ |
+
"Running" |
+PipelineRunReasonRunning is the reason set when the PipelineRun is running
+ |
+
"Started" |
+PipelineRunReasonStarted is the reason set when the PipelineRun has just started
+ |
+
"StoppedRunningFinally" |
+PipelineRunReasonStoppedRunningFinally indicates that pipeline has been gracefully stopped
+and no new Tasks will be scheduled by the controller, but final tasks are now running
+ |
+
"PipelineRunStopping" |
+PipelineRunReasonStopping indicates that no new Tasks will be scheduled by the controller, and the
+pipeline will stop once all running tasks complete their work
+ |
+
"Succeeded" |
+PipelineRunReasonSuccessful is the reason set when the PipelineRun completed successfully
+ |
+
"PipelineRunTimeout" |
+PipelineRunReasonTimedOut is the reason set when the PipelineRun has timed out
+ |
+
+
+
PipelineRunResult
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
PipelineRunResult used to describe the results of a pipeline
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the result’s name as declared by the Pipeline
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ Value is the result returned from the execution of this PipelineRun
+ |
+
+
+
+
PipelineRunRunStatus
+
+
+
PipelineRunRunStatus contains the name of the PipelineTask for this Run and the Run’s Status
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineTaskName
+
+string
+
+ |
+
+ PipelineTaskName is the name of the PipelineTask.
+ |
+
+
+
+status
+
+
+RunStatus
+
+
+ |
+
+(Optional)
+ Status is the RunStatus for the corresponding Run
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
PipelineRunSpec
+
+
+(Appears on:PipelineRun)
+
+
+
PipelineRunSpec defines the desired state of PipelineRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineRef
+
+
+PipelineRef
+
+
+ |
+
+(Optional)
+ |
+
+
+
+pipelineSpec
+
+
+PipelineSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+ Params is a list of parameter names and values.
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+PipelineRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a pipelinerun (and maybe more later on)
+ |
+
+
+
+timeouts
+
+
+TimeoutFields
+
+
+ |
+
+(Optional)
+ Time after which the Pipeline times out.
+Currently three keys are accepted in the map
+pipeline, tasks and finally
+with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces holds a set of workspace bindings that must match names
+with those declared in the pipeline.
+ |
+
+
+
+taskRunSpecs
+
+
+[]PipelineTaskRunSpec
+
+
+ |
+
+(Optional)
+ TaskRunSpecs holds a set of runtime specs
+ |
+
+
+
+
PipelineRunSpecStatus
+(string
alias)
+
+(Appears on:PipelineRunSpec)
+
+
+
PipelineRunSpecStatus defines the pipelinerun spec status the user can provide
+
+
PipelineRunStatus
+
+
+(Appears on:PipelineRun)
+
+
+
PipelineRunStatus defines the observed state of PipelineRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+Status
+
+
+knative.dev/pkg/apis/duck/v1beta1.Status
+
+
+ |
+
+
+(Members of Status are embedded into this type.)
+
+ |
+
+
+
+PipelineRunStatusFields
+
+
+PipelineRunStatusFields
+
+
+ |
+
+
+(Members of PipelineRunStatusFields are embedded into this type.)
+
+PipelineRunStatusFields inlines the status fields.
+ |
+
+
+
+
PipelineRunStatusFields
+
+
+(Appears on:PipelineRunStatus)
+
+
+
PipelineRunStatusFields holds the fields of PipelineRunStatus’ status.
+This is defined separately and inlined so that other types can readily
+consume these fields via duck typing.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+startTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ StartTime is the time the PipelineRun is actually started.
+ |
+
+
+
+completionTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ CompletionTime is the time the PipelineRun completed.
+ |
+
+
+
+results
+
+
+[]PipelineRunResult
+
+
+ |
+
+(Optional)
+ Results are the list of results written out by the pipeline task’s containers
+ |
+
+
+
+pipelineSpec
+
+
+PipelineSpec
+
+
+ |
+
+ PipelineRunSpec contains the exact spec used to instantiate the run
+ |
+
+
+
+skippedTasks
+
+
+[]SkippedTask
+
+
+ |
+
+(Optional)
+ list of tasks that were skipped due to when expressions evaluating to false
+ |
+
+
+
+childReferences
+
+
+[]ChildStatusReference
+
+
+ |
+
+(Optional)
+ list of TaskRun and Run names, PipelineTask names, and API versions/kinds for children of this PipelineRun.
+ |
+
+
+
+finallyStartTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ FinallyStartTime is when all non-finally tasks have been completed and only finally tasks are being executed.
+ |
+
+
+
+
PipelineRunTaskRunStatus
+
+
+
PipelineRunTaskRunStatus contains the name of the PipelineTask for this TaskRun and the TaskRun’s Status
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineTaskName
+
+string
+
+ |
+
+ PipelineTaskName is the name of the PipelineTask.
+ |
+
+
+
+status
+
+
+TaskRunStatus
+
+
+ |
+
+(Optional)
+ Status is the TaskRunStatus for the corresponding TaskRun
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
PipelineSpec
+
+
+(Appears on:Pipeline, PipelineRunSpec, PipelineRunStatusFields)
+
+
+
PipelineSpec defines the desired state of Pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the pipeline that may be
+used to populate a UI.
+ |
+
+
+
+tasks
+
+
+[]PipelineTask
+
+
+ |
+
+ Tasks declares the graph of Tasks that execute when this Pipeline is run.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+ Params declares a list of input parameters that must be supplied when
+this Pipeline is run.
+ |
+
+
+
+workspaces
+
+
+[]PipelineWorkspaceDeclaration
+
+
+ |
+
+(Optional)
+ Workspaces declares a set of named workspaces that are expected to be
+provided by a PipelineRun.
+ |
+
+
+
+results
+
+
+[]PipelineResult
+
+
+ |
+
+(Optional)
+ Results are values that this pipeline can output once run
+ |
+
+
+
+finally
+
+
+[]PipelineTask
+
+
+ |
+
+ 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
+ |
+
+
+
+
PipelineTask
+
+
+(Appears on:PipelineSpec)
+
+
+
PipelineTask defines a task in a Pipeline, passing inputs from both
+Params and from the output of previous tasks.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ 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.
+ |
+
+
+
+taskRef
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ TaskRef is a reference to a task definition.
+ |
+
+
+
+taskSpec
+
+
+EmbeddedTask
+
+
+ |
+
+(Optional)
+ TaskSpec is a specification of a task
+ |
+
+
+
+when
+
+
+WhenExpressions
+
+
+ |
+
+(Optional)
+ When is a list of when expressions that need to be true for the task to run
+ |
+
+
+
+retries
+
+int
+
+ |
+
+(Optional)
+ Retries represents how many times this task should be retried in case of task failure: ConditionSucceeded set to False
+ |
+
+
+
+runAfter
+
+[]string
+
+ |
+
+(Optional)
+ RunAfter is the list of PipelineTask names that should be executed before
+this Task executes. (Used to force a specific ordering in graph execution.)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ Parameters declares parameters passed to this task.
+ |
+
+
+
+matrix
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ Matrix declares parameters used to fan out this task.
+ |
+
+
+
+workspaces
+
+
+[]WorkspacePipelineTaskBinding
+
+
+ |
+
+(Optional)
+ Workspaces maps workspaces from the pipeline spec to the workspaces
+declared in the Task.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+
+
+(Appears on:EmbeddedTask, PipelineTaskRunSpec)
+
+
+
PipelineTaskMetadata contains the labels or annotations for an EmbeddedTask
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+labels
+
+map[string]string
+
+ |
+
+(Optional)
+ |
+
+
+
+annotations
+
+map[string]string
+
+ |
+
+(Optional)
+ |
+
+
+
+
PipelineTaskParam
+
+
+
PipelineTaskParam is used to provide arbitrary string parameters to a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+value
+
+string
+
+ |
+
+ |
+
+
+
+
PipelineTaskRun
+
+
+
PipelineTaskRun reports the results of running a step in the Task. Each
+task has the potential to succeed or fail (based on the exit code)
+and produces logs.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+
PipelineTaskRunSpec
+
+
+(Appears on:PipelineRunSpec)
+
+
+
PipelineTaskRunSpec can be used to configure specific
+specs for a concrete Task
+
+
+
PipelineWorkspaceDeclaration
+
+
+(Appears on:PipelineSpec)
+
+
+
WorkspacePipelineDeclaration creates a named slot in a Pipeline that a PipelineRun
+is expected to populate with a workspace binding.
+Deprecated: use PipelineWorkspaceDeclaration type instead
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of a workspace to be provided by a PipelineRun.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ 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
+
+bool
+
+ |
+
+ Optional marks a Workspace as not being required in PipelineRuns. By default
+this field is false and so declared workspaces are required.
+ |
+
+
+
+
PropertySpec
+
+
+(Appears on:ParamSpec, TaskResult)
+
+
+
PropertySpec defines the struct for object keys
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+type
+
+
+ParamType
+
+
+ |
+
+ |
+
+
+
+
ResolverName
+(string
alias)
+
+(Appears on:ResolverRef)
+
+
+
ResolverName is the name of a resolver from which a resource can be
+requested.
+
+
ResolverRef
+
+
+(Appears on:PipelineRef, TaskRef)
+
+
+
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.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+resolver
+
+
+ResolverName
+
+
+ |
+
+(Optional)
+ Resolver is the name of the resolver that should perform
+resolution of the referenced Tekton resource, such as “git”.
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ Params 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.
+ |
+
+
+
+
ResultRef
+
+
+
ResultRef is a type that represents a reference to a task run result
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineTask
+
+string
+
+ |
+
+ |
+
+
+
+result
+
+string
+
+ |
+
+ |
+
+
+
+resultsIndex
+
+int
+
+ |
+
+ |
+
+
+
+property
+
+string
+
+ |
+
+ |
+
+
+
+
ResultsType
+(string
alias)
+
+(Appears on:PipelineResult, TaskResult, TaskRunResult)
+
+
+
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.
+
+
+
+
+Value |
+Description |
+
+
+"array" |
+ |
+
"object" |
+ |
+
"string" |
+ |
+
+
+
Sidecar
+
+
+(Appears on:TaskSpec)
+
+
+
Sidecar has nearly the same data structure as Step but does not have the ability to timeout.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the Sidecar specified as a DNS_LABEL.
+Each Sidecar in a Task must have a unique name (DNS_LABEL).
+Cannot be updated.
+ |
+
+
+
+image
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+ports
+
+
+[]Kubernetes core/v1.ContainerPort
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the Sidecar.
+Cannot be updated.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+(Optional)
+ Compute Resources required by this Sidecar.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Volumes to mount into the Sidecar’s filesystem.
+Cannot be updated.
+ |
+
+
+
+volumeDevices
+
+
+[]Kubernetes core/v1.VolumeDevice
+
+
+ |
+
+(Optional)
+ volumeDevices is the list of block devices to be used by the Sidecar.
+ |
+
+
+
+livenessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+readinessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+startupProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+lifecycle
+
+
+Kubernetes core/v1.Lifecycle
+
+
+ |
+
+(Optional)
+ Actions that the management system should take in response to Sidecar lifecycle events.
+Cannot be updated.
+ |
+
+
+
+terminationMessagePath
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+terminationMessagePolicy
+
+
+Kubernetes core/v1.TerminationMessagePolicy
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ 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/
+ |
+
+
+
+stdin
+
+bool
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+stdinOnce
+
+bool
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+tty
+
+bool
+
+ |
+
+(Optional)
+ Whether this Sidecar should allocate a TTY for itself, also requires ‘stdin’ to be true.
+Default is false.
+ |
+
+
+
+script
+
+string
+
+ |
+
+(Optional)
+ Script is the contents of an executable file to execute.
+If Script is not empty, the Step cannot have an Command or Args.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceUsage
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+
SidecarState
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
SidecarState reports the results of running a sidecar in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+ContainerState
+
+
+Kubernetes core/v1.ContainerState
+
+
+ |
+
+
+(Members of ContainerState are embedded into this type.)
+
+ |
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+container
+
+string
+
+ |
+
+ |
+
+
+
+imageID
+
+string
+
+ |
+
+ |
+
+
+
+
SkippedTask
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
SkippedTask is used to describe the Tasks that were skipped due to their When Expressions
+evaluating to False. This is a struct because we are looking into including more details
+about the When Expressions that caused this Task to be skipped.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the Pipeline Task name
+ |
+
+
+
+reason
+
+
+SkippingReason
+
+
+ |
+
+ Reason is the cause of the PipelineTask being skipped.
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
SkippingReason
+(string
alias)
+
+(Appears on:SkippedTask)
+
+
+
SkippingReason explains why a PipelineTask was skipped.
+
+
+
+
+Value |
+Description |
+
+
+"PipelineRun Finally timeout has been reached" |
+FinallyTimedOutSkip means the task was skipped because the PipelineRun has passed its Timeouts.Finally.
+ |
+
"PipelineRun was gracefully cancelled" |
+GracefullyCancelledSkip means the task was skipped because the pipeline run has been gracefully cancelled
+ |
+
"PipelineRun was gracefully stopped" |
+GracefullyStoppedSkip means the task was skipped because the pipeline run has been gracefully stopped
+ |
+
"Results were missing" |
+MissingResultsSkip means the task was skipped because it’s missing necessary results
+ |
+
"None" |
+None means the task was not skipped
+ |
+
"Parent Tasks were skipped" |
+ParentTasksSkip means the task was skipped because its parent was skipped
+ |
+
"PipelineRun timeout has been reached" |
+PipelineTimedOutSkip means the task was skipped because the PipelineRun has passed its overall timeout.
+ |
+
"PipelineRun was stopping" |
+StoppingSkip means the task was skipped because the pipeline run is stopping
+ |
+
"PipelineRun Tasks timeout has been reached" |
+TasksTimedOutSkip means the task was skipped because the PipelineRun has passed its Timeouts.Tasks.
+ |
+
"When Expressions evaluated to false" |
+WhenExpressionsSkip means the task was skipped due to at least one of its when expressions evaluating to false
+ |
+
+
+
Step
+
+
+(Appears on:TaskSpec)
+
+
+
Step runs a subcomponent of a Task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the Step specified as a DNS_LABEL.
+Each Step in a Task must have a unique name.
+ |
+
+
+
+image
+
+string
+
+ |
+
+(Optional)
+ Docker image name.
+More info: https://kubernetes.io/docs/concepts/containers/images
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the Step.
+Cannot be updated.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+(Optional)
+ Compute Resources required by this Step.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Volumes to mount into the Step’s filesystem.
+Cannot be updated.
+ |
+
+
+
+volumeDevices
+
+
+[]Kubernetes core/v1.VolumeDevice
+
+
+ |
+
+(Optional)
+ volumeDevices is the list of block devices to be used by the Step.
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ 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/
+ |
+
+
+
+script
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceUsage
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+onError
+
+
+OnErrorType
+
+
+ |
+
+ OnError defines the exiting behavior of a container on error
+can be set to [ continue | stopAndFail ]
+ |
+
+
+
+stdoutConfig
+
+
+StepOutputConfig
+
+
+ |
+
+(Optional)
+ Stores configuration for the stdout stream of the step.
+ |
+
+
+
+stderrConfig
+
+
+StepOutputConfig
+
+
+ |
+
+(Optional)
+ Stores configuration for the stderr stream of the step.
+ |
+
+
+
+
StepOutputConfig
+
+
+(Appears on:Step)
+
+
+
StepOutputConfig stores configuration for a step output stream.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+path
+
+string
+
+ |
+
+(Optional)
+ Path to duplicate stdout stream to on container’s local filesystem.
+ |
+
+
+
+
StepState
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
StepState reports the results of running a step in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+ContainerState
+
+
+Kubernetes core/v1.ContainerState
+
+
+ |
+
+
+(Members of ContainerState are embedded into this type.)
+
+ |
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+container
+
+string
+
+ |
+
+ |
+
+
+
+imageID
+
+string
+
+ |
+
+ |
+
+
+
+
StepTemplate
+
+
+(Appears on:TaskSpec)
+
+
+
StepTemplate is a template for a Step
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+image
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the Step.
+Cannot be updated.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+(Optional)
+ Compute Resources required by this Step.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Volumes to mount into the Step’s filesystem.
+Cannot be updated.
+ |
+
+
+
+volumeDevices
+
+
+[]Kubernetes core/v1.VolumeDevice
+
+
+ |
+
+(Optional)
+ volumeDevices is the list of block devices to be used by the Step.
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ 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/
+ |
+
+
+
+
TaskKind
+(string
alias)
+
+(Appears on:TaskRef)
+
+
+
TaskKind defines the type of Task used by the pipeline.
+
+
+
+
+Value |
+Description |
+
+
+"Task" |
+NamespacedTaskKind indicates that the task type has a namespaced scope.
+ |
+
+
+
TaskRef
+
+
+(Appears on:PipelineTask, TaskRunSpec)
+
+
+
TaskRef can be used to refer to a specific instance of a task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ |
+
+
+
+kind
+
+
+TaskKind
+
+
+ |
+
+ TaskKind indicates the kind of the task, namespaced or cluster scoped.
+ |
+
+
+
+apiVersion
+
+string
+
+ |
+
+(Optional)
+ API version of the referent
+ |
+
+
+
+ResolverRef
+
+
+ResolverRef
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+
TaskResult
+
+
+(Appears on:TaskSpec)
+
+
+
TaskResult used to describe the results of a task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+type
+
+
+ResultsType
+
+
+ |
+
+(Optional)
+ Type is the user-specified type of the result. The possible type
+is currently “string” and will support “array” in following work.
+ |
+
+
+
+properties
+
+
+map[string]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PropertySpec
+
+
+ |
+
+(Optional)
+ Properties is the JSON Schema properties to support key-value pairs results.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a human-readable description of the result
+ |
+
+
+
+
TaskRunDebug
+
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunDebug defines the breakpoint config for a particular TaskRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+breakpoint
+
+[]string
+
+ |
+
+(Optional)
+ |
+
+
+
+
+
+
TaskRunInputs holds the input values that this task was invoked with.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+
TaskRunReason
+(string
alias)
+
+
TaskRunReason is an enum used to store all TaskRun reason for
+the Succeeded condition that are controlled by the TaskRun itself. Failure
+reasons that emerge from underlying resources are not included here
+
+
+
+
+Value |
+Description |
+
+
+"TaskRunCancelled" |
+TaskRunReasonCancelled is the reason set when the Taskrun is cancelled by the user
+ |
+
"Failed" |
+TaskRunReasonFailed is the reason set when the TaskRun completed with a failure
+ |
+
"TaskRunImagePullFailed" |
+TaskRunReasonImagePullFailed is the reason set when the step of a task fails due to image not being pulled
+ |
+
"Running" |
+TaskRunReasonRunning is the reason set when the TaskRun is running
+ |
+
"Started" |
+TaskRunReasonStarted is the reason set when the TaskRun has just started
+ |
+
"Succeeded" |
+TaskRunReasonSuccessful is the reason set when the TaskRun completed successfully
+ |
+
"TaskRunTimeout" |
+TaskRunReasonTimedOut is the reason set when the Taskrun has timed out
+ |
+
+
+
TaskRunResult
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
TaskRunResult used to describe the results of a task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+type
+
+
+ResultsType
+
+
+ |
+
+(Optional)
+ Type is the user-specified type of the result. The possible type
+is currently “string” and will support “array” in following work.
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ Value the given value of the result
+ |
+
+
+
+
TaskRunSidecarOverride
+
+
+(Appears on:PipelineTaskRunSpec, TaskRunSpec)
+
+
+
TaskRunSidecarOverride is used to override the values of a Sidecar in the corresponding Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ The name of the Sidecar to override.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ The resource requirements to apply to the Sidecar.
+ |
+
+
+
+
TaskRunSpec
+
+
+(Appears on:TaskRun)
+
+
+
TaskRunSpec defines the desired state of TaskRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+debug
+
+
+TaskRunDebug
+
+
+ |
+
+(Optional)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+taskRef
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ no more than one of the TaskRef and TaskSpec may be specified.
+ |
+
+
+
+taskSpec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+TaskRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a taskrun (and maybe more later on)
+ |
+
+
+
+statusMessage
+
+
+TaskRunSpecStatusMessage
+
+
+ |
+
+(Optional)
+ Status message for cancellation.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Time after which the build times out. Defaults to 1 hour.
+Specified build timeout should be less than 24h.
+Refer Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces is a list of WorkspaceBindings from volumes to workspaces.
+ |
+
+
+
+stepOverrides
+
+
+[]TaskRunStepOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Steps in this TaskRun.
+If a field is specified in both a Step and a StepOverride,
+the value from the StepOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+sidecarOverrides
+
+
+[]TaskRunSidecarOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Sidecars in this TaskRun.
+If a field is specified in both a Sidecar and a SidecarOverride,
+the value from the SidecarOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+computeResources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ Compute resources to use for this TaskRun
+ |
+
+
+
+
TaskRunSpecStatus
+(string
alias)
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunSpecStatus defines the taskrun spec status the user can provide
+
+
TaskRunSpecStatusMessage
+(string
alias)
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunSpecStatusMessage defines human readable status messages for the TaskRun.
+
+
+
+
+Value |
+Description |
+
+
+"TaskRun cancelled as the PipelineRun it belongs to has been cancelled." |
+TaskRunCancelledByPipelineMsg indicates that the PipelineRun of which this
+TaskRun was a part of has been cancelled.
+ |
+
+
+
TaskRunStatus
+
+
+(Appears on:TaskRun, PipelineRunTaskRunStatus, TaskRunStatusFields)
+
+
+
TaskRunStatus defines the observed state of TaskRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+Status
+
+
+knative.dev/pkg/apis/duck/v1.Status
+
+
+ |
+
+
+(Members of Status are embedded into this type.)
+
+ |
+
+
+
+TaskRunStatusFields
+
+
+TaskRunStatusFields
+
+
+ |
+
+
+(Members of TaskRunStatusFields are embedded into this type.)
+
+TaskRunStatusFields inlines the status fields.
+ |
+
+
+
+
TaskRunStatusFields
+
+
+(Appears on:TaskRunStatus)
+
+
+
TaskRunStatusFields holds the fields of TaskRun’s status. This is defined
+separately and inlined so that other types can readily consume these fields
+via duck typing.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+podName
+
+string
+
+ |
+
+ PodName is the name of the pod responsible for executing this task’s steps.
+ |
+
+
+
+startTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ StartTime is the time the build is actually started.
+ |
+
+
+
+completionTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ CompletionTime is the time the build completed.
+ |
+
+
+
+steps
+
+
+[]StepState
+
+
+ |
+
+(Optional)
+ Steps describes the state of each build step container.
+ |
+
+
+
+retriesStatus
+
+
+[]TaskRunStatus
+
+
+ |
+
+(Optional)
+ RetriesStatus contains the history of TaskRunStatus in case of a retry in order to keep record of failures.
+All TaskRunStatus stored in RetriesStatus will have no date within the RetriesStatus as is redundant.
+ |
+
+
+
+results
+
+
+[]TaskRunResult
+
+
+ |
+
+(Optional)
+ Results are the list of results written out by the task’s containers
+ |
+
+
+
+sidecars
+
+
+[]SidecarState
+
+
+ |
+
+ The list has one entry per sidecar in the manifest. Each entry is
+represents the imageid of the corresponding sidecar.
+ |
+
+
+
+taskSpec
+
+
+TaskSpec
+
+
+ |
+
+ TaskSpec contains the Spec from the dereferenced Task definition used to instantiate this TaskRun.
+ |
+
+
+
+
TaskRunStepOverride
+
+
+(Appears on:PipelineTaskRunSpec, TaskRunSpec)
+
+
+
TaskRunStepOverride is used to override the values of a Step in the corresponding Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ The name of the Step to override.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ The resource requirements to apply to the Step.
+ |
+
+
+
+
TaskSpec
+
+
+(Appears on:Task, EmbeddedTask, TaskRunSpec, TaskRunStatusFields)
+
+
+
TaskSpec defines the desired state of Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the task that may be
+used to populate a UI.
+ |
+
+
+
+steps
+
+
+[]Step
+
+
+ |
+
+ Steps are the steps of the build; each step is run sequentially with the
+source mounted into /workspace.
+ |
+
+
+
+volumes
+
+
+[]Kubernetes core/v1.Volume
+
+
+ |
+
+ Volumes is a collection of volumes that are available to mount into the
+steps of the build.
+ |
+
+
+
+stepTemplate
+
+
+StepTemplate
+
+
+ |
+
+ StepTemplate can be used as the basis for all step containers within the
+Task, so that the steps inherit settings on the base container.
+ |
+
+
+
+sidecars
+
+
+[]Sidecar
+
+
+ |
+
+ Sidecars are run alongside the Task’s step containers. They begin before
+the steps start and end after the steps complete.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceDeclaration
+
+
+ |
+
+ Workspaces are the volumes that this Task requires.
+ |
+
+
+
+results
+
+
+[]TaskResult
+
+
+ |
+
+ Results are values that this Task can output
+ |
+
+
+
+
TimeoutFields
+
+
+(Appears on:PipelineRunSpec)
+
+
+
TimeoutFields allows granular specification of pipeline, task, and finally timeouts
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipeline
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+ Pipeline sets the maximum allowed duration for execution of the entire pipeline. The sum of individual timeouts for tasks and finally must not exceed this value.
+ |
+
+
+
+tasks
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+ Tasks sets the maximum allowed duration of this pipeline’s tasks
+ |
+
+
+
+finally
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+ Finally sets the maximum allowed duration of this pipeline’s finally
+ |
+
+
+
+
WhenExpression
+
+
+(Appears on:ChildStatusReference, PipelineRunRunStatus, PipelineRunTaskRunStatus, SkippedTask)
+
+
+
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
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+input
+
+string
+
+ |
+
+ Input is the string for guard checking which can be a static input or an output from a parent Task
+ |
+
+
+
+operator
+
+k8s.io/apimachinery/pkg/selection.Operator
+
+ |
+
+ Operator that represents an Input’s relationship to the values
+ |
+
+
+
+values
+
+[]string
+
+ |
+
+ Values is an array of strings, which is compared against the input, for guard checking
+It must be non-empty
+ |
+
+
+
+
WhenExpressions
+([]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression
alias)
+
+(Appears on:PipelineTask)
+
+
+
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.
+
+
WorkspaceBinding
+
+
+(Appears on:PipelineRunSpec, TaskRunSpec)
+
+
+
WorkspaceBinding maps a Task’s declared workspace to a Volume.
+
+
+
WorkspaceDeclaration
+
+
+(Appears on:TaskSpec)
+
+
+
WorkspaceDeclaration is a declaration of a volume that a Task requires.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name by which you can bind the volume at runtime.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is an optional human readable description of this volume.
+ |
+
+
+
+mountPath
+
+string
+
+ |
+
+(Optional)
+ MountPath overrides the directory that the volume will be made available at.
+ |
+
+
+
+readOnly
+
+bool
+
+ |
+
+ ReadOnly dictates whether a mounted volume is writable. By default this
+field is false and so mounted volumes are writable.
+ |
+
+
+
+optional
+
+bool
+
+ |
+
+ Optional marks a Workspace as not being required in TaskRuns. By default
+this field is false and so declared workspaces are required.
+ |
+
+
+
+
WorkspacePipelineTaskBinding
+
+
+(Appears on:PipelineTask)
+
+
+
WorkspacePipelineTaskBinding describes how a workspace passed into the pipeline should be
+mapped to a task’s declared workspace.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the workspace as declared by the task
+ |
+
+
+
+workspace
+
+string
+
+ |
+
+(Optional)
+ Workspace is the name of the workspace declared by the pipeline
+ |
+
+
+
+subPath
+
+string
+
+ |
+
+(Optional)
+ 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).
+ |
+
+
+
+
WorkspaceUsage
+
+
+(Appears on:Sidecar, Step)
+
+
+
WorkspaceUsage is used by a Step or Sidecar to declare that it wants isolated access
+to a Workspace defined in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the workspace this Step or Sidecar wants access to.
+ |
+
+
+
+mountPath
+
+string
+
+ |
+
+ 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.
+ |
+
+
+
+
+
tekton.dev/v1alpha1
+
+
Package v1alpha1 contains API Schema definitions for the pipeline v1alpha1 API group
+
+Resource Types:
+
+
Run
+
+
+
Run represents a single execution of a Custom Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1alpha1
+
+ |
+
+
+
+kind
+string
+ |
+Run |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+RunSpec
+
+
+ |
+
+(Optional)
+
+
+
+
+
+ref
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ |
+
+
+
+spec
+
+
+EmbeddedRunSpec
+
+
+ |
+
+(Optional)
+ Spec is a specification of a custom task
+
+
+
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+RunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a run (and maybe more later on)
+ |
+
+
+
+statusMessage
+
+
+RunSpecStatusMessage
+
+
+ |
+
+(Optional)
+ Status message for cancellation.
+ |
+
+
+
+retries
+
+int
+
+ |
+
+(Optional)
+ Used for propagating retries count to custom tasks
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+(Optional)
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Time after which the custom-task times out.
+Refer Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces is a list of WorkspaceBindings from volumes to workspaces.
+ |
+
+
+ |
+
+
+
+status
+
+
+RunStatus
+
+
+ |
+
+(Optional)
+ |
+
+
+
+
PipelineResource
+
+
+
PipelineResource describes a resource that is an input to or output from a
+Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1alpha1
+
+ |
+
+
+
+kind
+string
+ |
+PipelineResource |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+PipelineResourceSpec
+
+
+ |
+
+ Spec holds the desired state of the PipelineResource from the client
+
+
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the resource that may be
+used to populate a UI.
+ |
+
+
+
+type
+
+string
+
+ |
+
+ |
+
+
+
+params
+
+
+[]ResourceParam
+
+
+ |
+
+ |
+
+
+
+secrets
+
+
+[]SecretParam
+
+
+ |
+
+(Optional)
+ Secrets to fetch to populate some of resource fields
+ |
+
+
+ |
+
+
+
+status
+
+
+PipelineResourceStatus
+
+
+ |
+
+(Optional)
+ Status is deprecated.
+It usually is used to communicate the observed state of the PipelineResource from
+the controller, but was unused as there is no controller for PipelineResource.
+ |
+
+
+
+
EmbeddedRunSpec
+
+
+(Appears on:RunSpec)
+
+
+
EmbeddedRunSpec allows custom task definitions to be embedded
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+metadata
+
+
+PipelineTaskMetadata
+
+
+ |
+
+(Optional)
+ |
+
+
+
+spec
+
+k8s.io/apimachinery/pkg/runtime.RawExtension
+
+ |
+
+(Optional)
+ Spec is a specification of a custom task
+
+
+
+
+
+-
+
+[]byte
+
+ |
+
+ Raw is the underlying serialization of this object.
+TODO: Determine how to detect ContentType and ContentEncoding of ‘Raw’ data.
+ |
+
+
+
+-
+
+k8s.io/apimachinery/pkg/runtime.Object
+
+ |
+
+ Object can hold a representation of this extension - useful for working with versioned
+structs.
+ |
+
+
+ |
+
+
+
+
RunSpec
+
+
+(Appears on:Run)
+
+
+
RunSpec defines the desired state of Run
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+ref
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ |
+
+
+
+spec
+
+
+EmbeddedRunSpec
+
+
+ |
+
+(Optional)
+ Spec is a specification of a custom task
+
+
+
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+RunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a run (and maybe more later on)
+ |
+
+
+
+statusMessage
+
+
+RunSpecStatusMessage
+
+
+ |
+
+(Optional)
+ Status message for cancellation.
+ |
+
+
+
+retries
+
+int
+
+ |
+
+(Optional)
+ Used for propagating retries count to custom tasks
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+(Optional)
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Time after which the custom-task times out.
+Refer Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces is a list of WorkspaceBindings from volumes to workspaces.
+ |
+
+
+
+
RunSpecStatus
+(string
alias)
+
+(Appears on:RunSpec)
+
+
+
RunSpecStatus defines the taskrun spec status the user can provide
+
+
RunSpecStatusMessage
+(string
alias)
+
+(Appears on:RunSpec)
+
+
+
RunSpecStatusMessage defines human readable status messages for the TaskRun.
+
+
PipelineResourceSpec
+
+
+(Appears on:PipelineResource, PipelineResourceBinding)
+
+
+
PipelineResourceSpec defines an individual resources used in the pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the resource that may be
+used to populate a UI.
+ |
+
+
+
+type
+
+string
+
+ |
+
+ |
+
+
+
+params
+
+
+[]ResourceParam
+
+
+ |
+
+ |
+
+
+
+secrets
+
+
+[]SecretParam
+
+
+ |
+
+(Optional)
+ Secrets to fetch to populate some of resource fields
+ |
+
+
+
+
PipelineResourceStatus
+
+
+(Appears on:PipelineResource)
+
+
+
PipelineResourceStatus does not contain anything because PipelineResources on their own
+do not have a status
+Deprecated
+
+
ResourceDeclaration
+
+
+(Appears on:TaskResource)
+
+
+
ResourceDeclaration defines an input or output PipelineResource declared as a requirement
+by another type such as a Task or Condition. The Name field will be used to refer to these
+PipelineResources within the type’s definition, and when provided as an Input, the Name will be the
+path to the volume mounted containing this PipelineResource as an input (e.g.
+an input Resource named workspace
will be mounted at /workspace
).
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name declares the name by which a resource is referenced in the
+definition. Resources may be referenced by name in the definition of a
+Task’s steps.
+ |
+
+
+
+type
+
+string
+
+ |
+
+ Type is the type of this resource;
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the declared resource that may be
+used to populate a UI.
+ |
+
+
+
+targetPath
+
+string
+
+ |
+
+(Optional)
+ TargetPath is the path in workspace directory where the resource
+will be copied.
+ |
+
+
+
+optional
+
+bool
+
+ |
+
+ Optional declares the resource as optional.
+By default optional is set to false which makes a resource required.
+optional: true - the resource is considered optional
+optional: false - the resource is considered required (equivalent of not specifying it)
+ |
+
+
+
+
ResourceParam
+
+
+(Appears on:PipelineResourceSpec)
+
+
+
ResourceParam declares a string value to use for the parameter called Name, and is used in
+the specific context of PipelineResources.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+value
+
+string
+
+ |
+
+ |
+
+
+
+
SecretParam
+
+
+(Appears on:PipelineResourceSpec)
+
+
+
SecretParam indicates which secret can be used to populate a field of the resource
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+fieldName
+
+string
+
+ |
+
+ |
+
+
+
+secretKey
+
+string
+
+ |
+
+ |
+
+
+
+secretName
+
+string
+
+ |
+
+ |
+
+
+
+
RunResult
+
+
+(Appears on:RunStatusFields)
+
+
+
RunResult used to describe the results of a task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+value
+
+string
+
+ |
+
+ Value the given value of the result
+ |
+
+
+
+
RunStatus
+
+
+(Appears on:Run, PipelineRunRunStatus, PipelineRunRunStatus, RunStatusFields)
+
+
+
RunStatus defines the observed state of Run
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+Status
+
+
+knative.dev/pkg/apis/duck/v1.Status
+
+
+ |
+
+
+(Members of Status are embedded into this type.)
+
+ |
+
+
+
+RunStatusFields
+
+
+RunStatusFields
+
+
+ |
+
+
+(Members of RunStatusFields are embedded into this type.)
+
+RunStatusFields inlines the status fields.
+ |
+
+
+
+
RunStatusFields
+
+
+(Appears on:RunStatus)
+
+
+
RunStatusFields holds the fields of Run’s status. This is defined
+separately and inlined so that other types can readily consume these fields
+via duck typing.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+startTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ StartTime is the time the build is actually started.
+ |
+
+
+
+completionTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ CompletionTime is the time the build completed.
+ |
+
+
+
+results
+
+
+[]RunResult
+
+
+ |
+
+(Optional)
+ Results reports any output result values to be consumed by later
+tasks in a pipeline.
+ |
+
+
+
+retriesStatus
+
+
+[]RunStatus
+
+
+ |
+
+(Optional)
+ RetriesStatus contains the history of RunStatus, in case of a retry.
+ |
+
+
+
+extraFields
+
+k8s.io/apimachinery/pkg/runtime.RawExtension
+
+ |
+
+ ExtraFields holds arbitrary fields provided by the custom task
+controller.
+ |
+
+
+
+
+
tekton.dev/v1beta1
+
+
Package v1beta1 contains API Schema definitions for the pipeline v1beta1 API group
+
+Resource Types:
+
+
ClusterTask
+
+
+
ClusterTask is a Task with a cluster scope. ClusterTasks are used to
+represent Tasks that should be publicly addressable from any namespace in the
+cluster.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1beta1
+
+ |
+
+
+
+kind
+string
+ |
+ClusterTask |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ Spec holds the desired state of the Task from the client
+
+
+
+
+
+resources
+
+
+TaskResources
+
+
+ |
+
+(Optional)
+ Resources is a list input and output resource to run the task
+Resources are represented in TaskRuns as bindings to instances of
+PipelineResources.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the task that may be
+used to populate a UI.
+ |
+
+
+
+steps
+
+
+[]Step
+
+
+ |
+
+ Steps are the steps of the build; each step is run sequentially with the
+source mounted into /workspace.
+ |
+
+
+
+volumes
+
+
+[]Kubernetes core/v1.Volume
+
+
+ |
+
+ Volumes is a collection of volumes that are available to mount into the
+steps of the build.
+ |
+
+
+
+stepTemplate
+
+
+StepTemplate
+
+
+ |
+
+ StepTemplate can be used as the basis for all step containers within the
+Task, so that the steps inherit settings on the base container.
+ |
+
+
+
+sidecars
+
+
+[]Sidecar
+
+
+ |
+
+ Sidecars are run alongside the Task’s step containers. They begin before
+the steps start and end after the steps complete.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceDeclaration
+
+
+ |
+
+ Workspaces are the volumes that this Task requires.
+ |
+
+
+
+results
+
+
+[]TaskResult
+
+
+ |
+
+ Results are values that this Task can output
+ |
+
+
+ |
+
+
+
+
Pipeline
+
+
+
Pipeline describes a list of Tasks to execute. It expresses how outputs
+of tasks feed into inputs of subsequent tasks.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1beta1
+
+ |
+
+
+
+kind
+string
+ |
+Pipeline |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+PipelineSpec
+
+
+ |
+
+(Optional)
+ Spec holds the desired state of the Pipeline from the client
+
+
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the pipeline that may be
+used to populate a UI.
+ |
+
+
+
+resources
+
+
+[]PipelineDeclaredResource
+
+
+ |
+
+ Resources declares the names and types of the resources given to the
+Pipeline’s tasks as inputs and outputs.
+ |
+
+
+
+tasks
+
+
+[]PipelineTask
+
+
+ |
+
+ Tasks declares the graph of Tasks that execute when this Pipeline is run.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+ Params declares a list of input parameters that must be supplied when
+this Pipeline is run.
+ |
+
+
+
+workspaces
+
+
+[]PipelineWorkspaceDeclaration
+
+
+ |
+
+(Optional)
+ Workspaces declares a set of named workspaces that are expected to be
+provided by a PipelineRun.
+ |
+
+
+
+results
+
+
+[]PipelineResult
+
+
+ |
+
+(Optional)
+ Results are values that this pipeline can output once run
+ |
+
+
+
+finally
+
+
+[]PipelineTask
+
+
+ |
+
+ 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
+ |
+
+
+ |
+
+
+
+
PipelineRun
+
+
+
PipelineRun represents a single execution of a Pipeline. PipelineRuns are how
+the graph of Tasks declared in a Pipeline are executed; they specify inputs
+to Pipelines such as parameter values and capture operational aspects of the
+Tasks execution such as service account and tolerations. Creating a
+PipelineRun creates TaskRuns for Tasks in the referenced Pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1beta1
+
+ |
+
+
+
+kind
+string
+ |
+PipelineRun |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+PipelineRunSpec
+
+
+ |
+
+(Optional)
+
+
+
+
+
+pipelineRef
+
+
+PipelineRef
+
+
+ |
+
+(Optional)
+ |
+
+
+
+pipelineSpec
+
+
+PipelineSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+resources
+
+
+[]PipelineResourceBinding
+
+
+ |
+
+ Resources is a list of bindings specifying which actual instances of
+PipelineResources to use for the resources the Pipeline has declared
+it needs.
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+ Params is a list of parameter names and values.
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+PipelineRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a pipelinerun (and maybe more later on)
+ |
+
+
+
+timeouts
+
+
+TimeoutFields
+
+
+ |
+
+(Optional)
+ Time after which the Pipeline times out.
+Currently three keys are accepted in the map
+pipeline, tasks and finally
+with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Timeout Deprecated: use pipelineRunSpec.Timeouts.Pipeline instead
+Time after which the Pipeline times out. Defaults to never.
+Refer to Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces holds a set of workspace bindings that must match names
+with those declared in the pipeline.
+ |
+
+
+
+taskRunSpecs
+
+
+[]PipelineTaskRunSpec
+
+
+ |
+
+(Optional)
+ TaskRunSpecs holds a set of runtime specs
+ |
+
+
+ |
+
+
+
+status
+
+
+PipelineRunStatus
+
+
+ |
+
+(Optional)
+ |
+
+
+
+
Task
+
+
+
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.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1beta1
+
+ |
+
+
+
+kind
+string
+ |
+Task |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ Spec holds the desired state of the Task from the client
+
+
+
+
+
+resources
+
+
+TaskResources
+
+
+ |
+
+(Optional)
+ Resources is a list input and output resource to run the task
+Resources are represented in TaskRuns as bindings to instances of
+PipelineResources.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the task that may be
+used to populate a UI.
+ |
+
+
+
+steps
+
+
+[]Step
+
+
+ |
+
+ Steps are the steps of the build; each step is run sequentially with the
+source mounted into /workspace.
+ |
+
+
+
+volumes
+
+
+[]Kubernetes core/v1.Volume
+
+
+ |
+
+ Volumes is a collection of volumes that are available to mount into the
+steps of the build.
+ |
+
+
+
+stepTemplate
+
+
+StepTemplate
+
+
+ |
+
+ StepTemplate can be used as the basis for all step containers within the
+Task, so that the steps inherit settings on the base container.
+ |
+
+
+
+sidecars
+
+
+[]Sidecar
+
+
+ |
+
+ Sidecars are run alongside the Task’s step containers. They begin before
+the steps start and end after the steps complete.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceDeclaration
+
+
+ |
+
+ Workspaces are the volumes that this Task requires.
+ |
+
+
+
+results
+
+
+[]TaskResult
+
+
+ |
+
+ Results are values that this Task can output
+ |
+
+
+ |
+
+
+
+
TaskRun
+
+
+
TaskRun represents a single execution of a Task. TaskRuns are how the steps
+specified in a Task are executed; they specify the parameters and resources
+used to run the steps in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+tekton.dev/v1beta1
+
+ |
+
+
+
+kind
+string
+ |
+TaskRun |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+(Optional)
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+TaskRunSpec
+
+
+ |
+
+(Optional)
+
+
+
+
+
+debug
+
+
+TaskRunDebug
+
+
+ |
+
+(Optional)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+resources
+
+
+TaskRunResources
+
+
+ |
+
+(Optional)
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+taskRef
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ no more than one of the TaskRef and TaskSpec may be specified.
+ |
+
+
+
+taskSpec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+TaskRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a taskrun (and maybe more later on)
+ |
+
+
+
+statusMessage
+
+
+TaskRunSpecStatusMessage
+
+
+ |
+
+(Optional)
+ Status message for cancellation.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Time after which the build times out. Defaults to 1 hour.
+Specified build timeout should be less than 24h.
+Refer Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces is a list of WorkspaceBindings from volumes to workspaces.
+ |
+
+
+
+stepOverrides
+
+
+[]TaskRunStepOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Steps in this TaskRun.
+If a field is specified in both a Step and a StepOverride,
+the value from the StepOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+sidecarOverrides
+
+
+[]TaskRunSidecarOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Sidecars in this TaskRun.
+If a field is specified in both a Sidecar and a SidecarOverride,
+the value from the SidecarOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+computeResources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ Compute resources to use for this TaskRun
+ |
+
+
+ |
+
+
+
+status
+
+
+TaskRunStatus
+
+
+ |
+
+(Optional)
+ |
+
+
+
+
ChildStatusReference
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
ChildStatusReference is used to point to the statuses of individual TaskRuns and Runs within this PipelineRun.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the TaskRun or Run this is referencing.
+ |
+
+
+
+pipelineTaskName
+
+string
+
+ |
+
+ PipelineTaskName is the name of the PipelineTask this is referencing.
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
CloudEventCondition
+(string
alias)
+
+(Appears on:CloudEventDeliveryState)
+
+
+
CloudEventCondition is a string that represents the condition of the event.
+
+
+
+
+Value |
+Description |
+
+
+"Failed" |
+CloudEventConditionFailed means that there was one or more attempts to
+send the event, and none was successful so far.
+ |
+
"Sent" |
+CloudEventConditionSent means that the event was sent successfully
+ |
+
"Unknown" |
+CloudEventConditionUnknown means that the condition for the event to be
+triggered was not met yet, or we don’t know the state yet.
+ |
+
+
+
CloudEventDelivery
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
CloudEventDelivery is the target of a cloud event along with the state of
+delivery.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+target
+
+string
+
+ |
+
+ Target points to an addressable
+ |
+
+
+
+status
+
+
+CloudEventDeliveryState
+
+
+ |
+
+ |
+
+
+
+
CloudEventDeliveryState
+
+
+(Appears on:CloudEventDelivery)
+
+
+
CloudEventDeliveryState reports the state of a cloud event to be sent.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+condition
+
+
+CloudEventCondition
+
+
+ |
+
+ Current status
+ |
+
+
+
+sentAt
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ SentAt is the time at which the last attempt to send the event was made
+ |
+
+
+
+message
+
+string
+
+ |
+
+ Error is the text of error (if any)
+ |
+
+
+
+retryCount
+
+int32
+
+ |
+
+ RetryCount is the number of attempts of sending the cloud event
+ |
+
+
+
+
EmbeddedTask
+
+
+(Appears on:PipelineTask)
+
+
+
EmbeddedTask is used to define a Task inline within a Pipeline’s PipelineTasks.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+spec
+
+k8s.io/apimachinery/pkg/runtime.RawExtension
+
+ |
+
+(Optional)
+ Spec is a specification of a custom task
+
+
+
+
+
+-
+
+[]byte
+
+ |
+
+ Raw is the underlying serialization of this object.
+TODO: Determine how to detect ContentType and ContentEncoding of ‘Raw’ data.
+ |
+
+
+
+-
+
+k8s.io/apimachinery/pkg/runtime.Object
+
+ |
+
+ Object can hold a representation of this extension - useful for working with versioned
+structs.
+ |
+
+
+ |
+
+
+
+metadata
+
+
+PipelineTaskMetadata
+
+
+ |
+
+(Optional)
+ |
+
+
+
+TaskSpec
+
+
+TaskSpec
+
+
+ |
+
+
+(Members of TaskSpec are embedded into this type.)
+
+(Optional)
+TaskSpec is a specification of a task
+ |
+
+
+
+
InternalTaskModifier
+
+
+
InternalTaskModifier implements TaskModifier for resources that are built-in to Tekton Pipelines.
+
+
+
OnErrorType
+(string
alias)
+
+(Appears on:Step)
+
+
+
OnErrorType defines a list of supported exiting behavior of a container on error
+
+
+
+
+Value |
+Description |
+
+
+"continue" |
+Continue indicates continue executing the rest of the steps irrespective of the container exit code
+ |
+
"stopAndFail" |
+StopAndFail indicates exit the taskRun if the container exits with non-zero exit code
+ |
+
+
+
Param
+
+
+(Appears on:RunSpec, PipelineRunSpec, PipelineTask, ResolverRef, TaskRunInputs, TaskRunSpec)
+
+
+
Param declares an ParamValues to use for the parameter called name.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ |
+
+
+
+
ParamSpec
+
+
+(Appears on:PipelineSpec, TaskSpec)
+
+
+
ParamSpec defines arbitrary parameters needed beyond typed inputs (such as
+resources). Parameter values are provided by users as inputs on a TaskRun
+or PipelineRun.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name declares the name by which a parameter is referenced.
+ |
+
+
+
+type
+
+
+ParamType
+
+
+ |
+
+(Optional)
+ Type is the user-specified type of the parameter. The possible types
+are currently “string”, “array” and “object”, and “string” is the default.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the parameter that may be
+used to populate a UI.
+ |
+
+
+
+properties
+
+
+map[string]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.PropertySpec
+
+
+ |
+
+(Optional)
+ Properties is the JSON Schema properties to support key-value pairs parameter.
+ |
+
+
+
+default
+
+
+ParamValue
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+
ParamType
+(string
alias)
+
+(Appears on:ParamSpec, ParamValue, PropertySpec)
+
+
+
ParamType indicates the type of an input parameter;
+Used to distinguish between a single string and an array of strings.
+
+
+
+
+Value |
+Description |
+
+
+"array" |
+ |
+
"object" |
+ |
+
"string" |
+ |
+
+
+
ParamValue
+
+
+(Appears on:Param, ParamSpec, PipelineResult, PipelineRunResult, TaskRunResult)
+
+
+
ResultValue is a type alias of ParamValue
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+type
+
+
+ParamType
+
+
+ |
+
+ |
+
+
+
+stringVal
+
+string
+
+ |
+
+ Represents the stored type of ParamValues.
+ |
+
+
+
+arrayVal
+
+[]string
+
+ |
+
+ |
+
+
+
+objectVal
+
+map[string]string
+
+ |
+
+ |
+
+
+
+
PipelineDeclaredResource
+
+
+(Appears on:PipelineSpec)
+
+
+
PipelineDeclaredResource is used by a Pipeline to declare the types of the
+PipelineResources that it will required to run and names which can be used to
+refer to these PipelineResources in PipelineTaskResourceBindings.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name that will be used by the Pipeline to refer to this resource.
+It does not directly correspond to the name of any PipelineResources Task
+inputs or outputs, and it does not correspond to the actual names of the
+PipelineResources that will be bound in the PipelineRun.
+ |
+
+
+
+type
+
+string
+
+ |
+
+ Type is the type of the PipelineResource.
+ |
+
+
+
+optional
+
+bool
+
+ |
+
+ Optional declares the resource as optional.
+optional: true - the resource is considered optional
+optional: false - the resource is considered required (default/equivalent of not specifying it)
+ |
+
+
+
+
PipelineObject
+
+
+
PipelineObject is implemented by Pipeline and ClusterPipeline
+
+
PipelineRef
+
+
+(Appears on:PipelineRunSpec)
+
+
+
PipelineRef can be used to refer to a specific instance of a Pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ |
+
+
+
+apiVersion
+
+string
+
+ |
+
+(Optional)
+ API version of the referent
+ |
+
+
+
+bundle
+
+string
+
+ |
+
+(Optional)
+ Bundle url reference to a Tekton Bundle.
+ |
+
+
+
+ResolverRef
+
+
+ResolverRef
+
+
+ |
+
+(Optional)
+ ResolverRef allows referencing a Pipeline in a remote location
+like a git repo. This field is only supported when the alpha
+feature gate is enabled.
+ |
+
+
+
+
PipelineResourceBinding
+
+
+(Appears on:PipelineRunSpec, TaskResourceBinding)
+
+
+
PipelineResourceBinding connects a reference to an instance of a PipelineResource
+with a PipelineResource dependency that the Pipeline has declared
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the PipelineResource in the Pipeline’s declaration
+ |
+
+
+
+resourceRef
+
+
+PipelineResourceRef
+
+
+ |
+
+(Optional)
+ ResourceRef is a reference to the instance of the actual PipelineResource
+that should be used
+ |
+
+
+
+resourceSpec
+
+
+PipelineResourceSpec
+
+
+ |
+
+(Optional)
+ ResourceSpec is specification of a resource that should be created and
+consumed by the task
+ |
+
+
+
+
PipelineResourceInterface
+
+
+
PipelineResourceInterface interface to be implemented by different PipelineResource types
+
+
PipelineResourceRef
+
+
+(Appears on:PipelineResourceBinding)
+
+
+
PipelineResourceRef can be used to refer to a specific instance of a Resource
+
+
+
PipelineResourceResult
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
PipelineResourceResult used to export the image name and digest as json
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+key
+
+string
+
+ |
+
+ |
+
+
+
+value
+
+string
+
+ |
+
+ |
+
+
+
+resourceName
+
+string
+
+ |
+
+ |
+
+
+
+type
+
+
+ResultType
+
+
+ |
+
+ |
+
+
+
+
PipelineResult
+
+
+(Appears on:PipelineSpec)
+
+
+
PipelineResult used to describe the results of a pipeline
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+type
+
+
+ResultsType
+
+
+ |
+
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a human-readable description of the result
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ Value the expression used to retrieve the value
+ |
+
+
+
+
PipelineRunReason
+(string
alias)
+
+
PipelineRunReason represents a reason for the pipeline run “Succeeded” condition
+
+
+
+
+Value |
+Description |
+
+
+"Cancelled" |
+PipelineRunReasonCancelled is the reason set when the PipelineRun cancelled by the user
+This reason may be found with a corev1.ConditionFalse status, if the cancellation was processed successfully
+This reason may be found with a corev1.ConditionUnknown status, if the cancellation is being processed or failed
+ |
+
"CancelledRunningFinally" |
+PipelineRunReasonCancelledRunningFinally indicates that pipeline has been gracefully cancelled
+and no new Tasks will be scheduled by the controller, but final tasks are now running
+ |
+
"Completed" |
+PipelineRunReasonCompleted is the reason set when the PipelineRun completed successfully with one or more skipped Tasks
+ |
+
"Failed" |
+PipelineRunReasonFailed is the reason set when the PipelineRun completed with a failure
+ |
+
"PipelineRunPending" |
+PipelineRunReasonPending is the reason set when the PipelineRun is in the pending state
+ |
+
"Running" |
+PipelineRunReasonRunning is the reason set when the PipelineRun is running
+ |
+
"Started" |
+PipelineRunReasonStarted is the reason set when the PipelineRun has just started
+ |
+
"StoppedRunningFinally" |
+PipelineRunReasonStoppedRunningFinally indicates that pipeline has been gracefully stopped
+and no new Tasks will be scheduled by the controller, but final tasks are now running
+ |
+
"PipelineRunStopping" |
+PipelineRunReasonStopping indicates that no new Tasks will be scheduled by the controller, and the
+pipeline will stop once all running tasks complete their work
+ |
+
"Succeeded" |
+PipelineRunReasonSuccessful is the reason set when the PipelineRun completed successfully
+ |
+
"PipelineRunTimeout" |
+PipelineRunReasonTimedOut is the reason set when the PipelineRun has timed out
+ |
+
+
+
PipelineRunResult
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
PipelineRunResult used to describe the results of a pipeline
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the result’s name as declared by the Pipeline
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ Value is the result returned from the execution of this PipelineRun
+ |
+
+
+
+
PipelineRunRunStatus
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
PipelineRunRunStatus contains the name of the PipelineTask for this Run and the Run’s Status
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineTaskName
+
+string
+
+ |
+
+ PipelineTaskName is the name of the PipelineTask.
+ |
+
+
+
+status
+
+
+RunStatus
+
+
+ |
+
+(Optional)
+ Status is the RunStatus for the corresponding Run
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
PipelineRunSpec
+
+
+(Appears on:PipelineRun)
+
+
+
PipelineRunSpec defines the desired state of PipelineRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineRef
+
+
+PipelineRef
+
+
+ |
+
+(Optional)
+ |
+
+
+
+pipelineSpec
+
+
+PipelineSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+resources
+
+
+[]PipelineResourceBinding
+
+
+ |
+
+ Resources is a list of bindings specifying which actual instances of
+PipelineResources to use for the resources the Pipeline has declared
+it needs.
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+ Params is a list of parameter names and values.
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+PipelineRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a pipelinerun (and maybe more later on)
+ |
+
+
+
+timeouts
+
+
+TimeoutFields
+
+
+ |
+
+(Optional)
+ Time after which the Pipeline times out.
+Currently three keys are accepted in the map
+pipeline, tasks and finally
+with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Timeout Deprecated: use pipelineRunSpec.Timeouts.Pipeline instead
+Time after which the Pipeline times out. Defaults to never.
+Refer to Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces holds a set of workspace bindings that must match names
+with those declared in the pipeline.
+ |
+
+
+
+taskRunSpecs
+
+
+[]PipelineTaskRunSpec
+
+
+ |
+
+(Optional)
+ TaskRunSpecs holds a set of runtime specs
+ |
+
+
+
+
PipelineRunSpecStatus
+(string
alias)
+
+(Appears on:PipelineRunSpec)
+
+
+
PipelineRunSpecStatus defines the pipelinerun spec status the user can provide
+
+
PipelineRunStatus
+
+
+(Appears on:PipelineRun)
+
+
+
PipelineRunStatus defines the observed state of PipelineRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+Status
+
+
+knative.dev/pkg/apis/duck/v1beta1.Status
+
+
+ |
+
+
+(Members of Status are embedded into this type.)
+
+ |
+
+
+
+PipelineRunStatusFields
+
+
+PipelineRunStatusFields
+
+
+ |
+
+
+(Members of PipelineRunStatusFields are embedded into this type.)
+
+PipelineRunStatusFields inlines the status fields.
+ |
+
+
+
+
PipelineRunStatusFields
+
+
+(Appears on:PipelineRunStatus)
+
+
+
PipelineRunStatusFields holds the fields of PipelineRunStatus’ status.
+This is defined separately and inlined so that other types can readily
+consume these fields via duck typing.
+
+
+
PipelineRunTaskRunStatus
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
PipelineRunTaskRunStatus contains the name of the PipelineTask for this TaskRun and the TaskRun’s Status
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineTaskName
+
+string
+
+ |
+
+ PipelineTaskName is the name of the PipelineTask.
+ |
+
+
+
+status
+
+
+TaskRunStatus
+
+
+ |
+
+(Optional)
+ Status is the TaskRunStatus for the corresponding TaskRun
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
PipelineSpec
+
+
+(Appears on:Pipeline, PipelineRunSpec, PipelineRunStatusFields)
+
+
+
PipelineSpec defines the desired state of Pipeline.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the pipeline that may be
+used to populate a UI.
+ |
+
+
+
+resources
+
+
+[]PipelineDeclaredResource
+
+
+ |
+
+ Resources declares the names and types of the resources given to the
+Pipeline’s tasks as inputs and outputs.
+ |
+
+
+
+tasks
+
+
+[]PipelineTask
+
+
+ |
+
+ Tasks declares the graph of Tasks that execute when this Pipeline is run.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+ Params declares a list of input parameters that must be supplied when
+this Pipeline is run.
+ |
+
+
+
+workspaces
+
+
+[]PipelineWorkspaceDeclaration
+
+
+ |
+
+(Optional)
+ Workspaces declares a set of named workspaces that are expected to be
+provided by a PipelineRun.
+ |
+
+
+
+results
+
+
+[]PipelineResult
+
+
+ |
+
+(Optional)
+ Results are values that this pipeline can output once run
+ |
+
+
+
+finally
+
+
+[]PipelineTask
+
+
+ |
+
+ 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
+ |
+
+
+
+
PipelineTask
+
+
+(Appears on:PipelineSpec)
+
+
+
PipelineTask defines a task in a Pipeline, passing inputs from both
+Params and from the output of previous tasks.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ 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.
+ |
+
+
+
+taskRef
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ TaskRef is a reference to a task definition.
+ |
+
+
+
+taskSpec
+
+
+EmbeddedTask
+
+
+ |
+
+(Optional)
+ TaskSpec is a specification of a task
+ |
+
+
+
+when
+
+
+WhenExpressions
+
+
+ |
+
+(Optional)
+ WhenExpressions is a list of when expressions that need to be true for the task to run
+ |
+
+
+
+retries
+
+int
+
+ |
+
+(Optional)
+ Retries represents how many times this task should be retried in case of task failure: ConditionSucceeded set to False
+ |
+
+
+
+runAfter
+
+[]string
+
+ |
+
+(Optional)
+ RunAfter is the list of PipelineTask names that should be executed before
+this Task executes. (Used to force a specific ordering in graph execution.)
+ |
+
+
+
+resources
+
+
+PipelineTaskResources
+
+
+ |
+
+(Optional)
+ Resources declares the resources given to this task as inputs and
+outputs.
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ Parameters declares parameters passed to this task.
+ |
+
+
+
+matrix
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ Matrix declares parameters used to fan out this task.
+ |
+
+
+
+workspaces
+
+
+[]WorkspacePipelineTaskBinding
+
+
+ |
+
+(Optional)
+ Workspaces maps workspaces from the pipeline spec to the workspaces
+declared in the Task.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+
+
+(Appears on:PipelineTaskResources)
+
+
+
PipelineTaskInputResource maps the name of a declared PipelineResource input
+dependency in a Task to the resource in the Pipeline’s DeclaredPipelineResources
+that should be used. This input may come from a previous task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the PipelineResource as declared by the Task.
+ |
+
+
+
+resource
+
+string
+
+ |
+
+ Resource is the name of the DeclaredPipelineResource to use.
+ |
+
+
+
+from
+
+[]string
+
+ |
+
+(Optional)
+ From is the list of PipelineTask names that the resource has to come from.
+(Implies an ordering in the execution graph.)
+ |
+
+
+
+
+
+(Appears on:EmbeddedRunSpec, EmbeddedTask, PipelineTaskRunSpec)
+
+
+
PipelineTaskMetadata contains the labels or annotations for an EmbeddedTask
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+labels
+
+map[string]string
+
+ |
+
+(Optional)
+ |
+
+
+
+annotations
+
+map[string]string
+
+ |
+
+(Optional)
+ |
+
+
+
+
PipelineTaskOutputResource
+
+
+(Appears on:PipelineTaskResources)
+
+
+
PipelineTaskOutputResource maps the name of a declared PipelineResource output
+dependency in a Task to the resource in the Pipeline’s DeclaredPipelineResources
+that should be used.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the PipelineResource as declared by the Task.
+ |
+
+
+
+resource
+
+string
+
+ |
+
+ Resource is the name of the DeclaredPipelineResource to use.
+ |
+
+
+
+
PipelineTaskParam
+
+
+
PipelineTaskParam is used to provide arbitrary string parameters to a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+value
+
+string
+
+ |
+
+ |
+
+
+
+
PipelineTaskResources
+
+
+(Appears on:PipelineTask)
+
+
+
PipelineTaskResources allows a Pipeline to declare how its DeclaredPipelineResources
+should be provided to a Task as its inputs and outputs.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+inputs
+
+
+[]PipelineTaskInputResource
+
+
+ |
+
+ Inputs holds the mapping from the PipelineResources declared in
+DeclaredPipelineResources to the input PipelineResources required by the Task.
+ |
+
+
+
+outputs
+
+
+[]PipelineTaskOutputResource
+
+
+ |
+
+ Outputs holds the mapping from the PipelineResources declared in
+DeclaredPipelineResources to the input PipelineResources required by the Task.
+ |
+
+
+
+
PipelineTaskRun
+
+
+
PipelineTaskRun reports the results of running a step in the Task. Each
+task has the potential to succeed or fail (based on the exit code)
+and produces logs.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+
PipelineTaskRunSpec
+
+
+(Appears on:PipelineRunSpec)
+
+
+
PipelineTaskRunSpec can be used to configure specific
+specs for a concrete Task
+
+
+
PipelineWorkspaceDeclaration
+
+
+(Appears on:PipelineSpec)
+
+
+
WorkspacePipelineDeclaration creates a named slot in a Pipeline that a PipelineRun
+is expected to populate with a workspace binding.
+Deprecated: use PipelineWorkspaceDeclaration type instead
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of a workspace to be provided by a PipelineRun.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ 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
+
+bool
+
+ |
+
+ Optional marks a Workspace as not being required in PipelineRuns. By default
+this field is false and so declared workspaces are required.
+ |
+
+
+
+
PropertySpec
+
+
+(Appears on:ParamSpec, TaskResult)
+
+
+
PropertySpec defines the struct for object keys
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+type
+
+
+ParamType
+
+
+ |
+
+ |
+
+
+
+
ResolverName
+(string
alias)
+
+(Appears on:ResolverRef)
+
+
+
ResolverName is the name of a resolver from which a resource can be
+requested.
+
+
ResolverRef
+
+
+(Appears on:PipelineRef, TaskRef)
+
+
+
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.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+resolver
+
+
+ResolverName
+
+
+ |
+
+(Optional)
+ Resolver is the name of the resolver that should perform
+resolution of the referenced Tekton resource, such as “git”.
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ Params 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.
+ |
+
+
+
+
ResultRef
+
+
+
ResultRef is a type that represents a reference to a task run result
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipelineTask
+
+string
+
+ |
+
+ |
+
+
+
+result
+
+string
+
+ |
+
+ |
+
+
+
+resultsIndex
+
+int
+
+ |
+
+ |
+
+
+
+property
+
+string
+
+ |
+
+ |
+
+
+
+
ResultType
+(int
alias)
+
+(Appears on:PipelineResourceResult)
+
+
+
ResultType used to find out whether a PipelineResourceResult is from a task result or not
+Note that ResultsType is another type which is used to define the data type
+(e.g. string, array, etc) we used for Results
+
+
+
+
+Value |
+Description |
+
+
+1 |
+TaskRunResultType default task run result value
+ |
+
+
+
ResultsType
+(string
alias)
+
+(Appears on:PipelineResult, TaskResult, TaskRunResult)
+
+
+
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.
+
+
+
+
+Value |
+Description |
+
+
+"array" |
+ |
+
"object" |
+ |
+
"string" |
+ |
+
+
+
Sidecar
+
+
+(Appears on:TaskSpec)
+
+
+
Sidecar has nearly the same data structure as Step but does not have the ability to timeout.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the Sidecar specified as a DNS_LABEL.
+Each Sidecar in a Task must have a unique name (DNS_LABEL).
+Cannot be updated.
+ |
+
+
+
+image
+
+string
+
+ |
+
+(Optional)
+ Image name to be used by the Sidecar.
+More info: https://kubernetes.io/docs/concepts/containers/images
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+ports
+
+
+[]Kubernetes core/v1.ContainerPort
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ 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 Sidecar 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.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the Sidecar.
+Cannot be updated.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+(Optional)
+ Compute Resources required by this Sidecar.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Volumes to mount into the Sidecar’s filesystem.
+Cannot be updated.
+ |
+
+
+
+volumeDevices
+
+
+[]Kubernetes core/v1.VolumeDevice
+
+
+ |
+
+(Optional)
+ volumeDevices is the list of block devices to be used by the Sidecar.
+ |
+
+
+
+livenessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+readinessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+startupProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+lifecycle
+
+
+Kubernetes core/v1.Lifecycle
+
+
+ |
+
+(Optional)
+ Actions that the management system should take in response to Sidecar lifecycle events.
+Cannot be updated.
+ |
+
+
+
+terminationMessagePath
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+terminationMessagePolicy
+
+
+Kubernetes core/v1.TerminationMessagePolicy
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ 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/
+ |
+
+
+
+stdin
+
+bool
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+stdinOnce
+
+bool
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+tty
+
+bool
+
+ |
+
+(Optional)
+ Whether this Sidecar should allocate a TTY for itself, also requires ‘stdin’ to be true.
+Default is false.
+ |
+
+
+
+script
+
+string
+
+ |
+
+(Optional)
+ Script is the contents of an executable file to execute.
+If Script is not empty, the Step cannot have an Command or Args.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceUsage
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+
SidecarState
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
SidecarState reports the results of running a sidecar in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+ContainerState
+
+
+Kubernetes core/v1.ContainerState
+
+
+ |
+
+
+(Members of ContainerState are embedded into this type.)
+
+ |
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+container
+
+string
+
+ |
+
+ |
+
+
+
+imageID
+
+string
+
+ |
+
+ |
+
+
+
+
SkippedTask
+
+
+(Appears on:PipelineRunStatusFields)
+
+
+
SkippedTask is used to describe the Tasks that were skipped due to their When Expressions
+evaluating to False. This is a struct because we are looking into including more details
+about the When Expressions that caused this Task to be skipped.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the Pipeline Task name
+ |
+
+
+
+reason
+
+
+SkippingReason
+
+
+ |
+
+ Reason is the cause of the PipelineTask being skipped.
+ |
+
+
+
+whenExpressions
+
+
+[]WhenExpression
+
+
+ |
+
+(Optional)
+ WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ |
+
+
+
+
SkippingReason
+(string
alias)
+
+(Appears on:SkippedTask)
+
+
+
SkippingReason explains why a PipelineTask was skipped.
+
+
+
+
+Value |
+Description |
+
+
+"PipelineRun Finally timeout has been reached" |
+FinallyTimedOutSkip means the task was skipped because the PipelineRun has passed its Timeouts.Finally.
+ |
+
"PipelineRun was gracefully cancelled" |
+GracefullyCancelledSkip means the task was skipped because the pipeline run has been gracefully cancelled
+ |
+
"PipelineRun was gracefully stopped" |
+GracefullyStoppedSkip means the task was skipped because the pipeline run has been gracefully stopped
+ |
+
"Results were missing" |
+MissingResultsSkip means the task was skipped because it’s missing necessary results
+ |
+
"None" |
+None means the task was not skipped
+ |
+
"Parent Tasks were skipped" |
+ParentTasksSkip means the task was skipped because its parent was skipped
+ |
+
"PipelineRun timeout has been reached" |
+PipelineTimedOutSkip means the task was skipped because the PipelineRun has passed its overall timeout.
+ |
+
"PipelineRun was stopping" |
+StoppingSkip means the task was skipped because the pipeline run is stopping
+ |
+
"PipelineRun Tasks timeout has been reached" |
+TasksTimedOutSkip means the task was skipped because the PipelineRun has passed its Timeouts.Tasks.
+ |
+
"When Expressions evaluated to false" |
+WhenExpressionsSkip means the task was skipped due to at least one of its when expressions evaluating to false
+ |
+
+
+
Step
+
+
+(Appears on:InternalTaskModifier, TaskSpec)
+
+
+
Step runs a subcomponent of a Task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the Step specified as a DNS_LABEL.
+Each Step in a Task must have a unique name.
+ |
+
+
+
+image
+
+string
+
+ |
+
+(Optional)
+ Image reference name to run for this Step.
+More info: https://kubernetes.io/docs/concepts/containers/images
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+ports
+
+
+[]Kubernetes core/v1.ContainerPort
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+List of ports to expose from the Step’s container. 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.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ List of sources to populate environment variables in the container.
+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.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the container.
+Cannot be updated.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+(Optional)
+ Compute Resources required by this Step.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Volumes to mount into the Step’s filesystem.
+Cannot be updated.
+ |
+
+
+
+volumeDevices
+
+
+[]Kubernetes core/v1.VolumeDevice
+
+
+ |
+
+(Optional)
+ volumeDevices is the list of block devices to be used by the Step.
+ |
+
+
+
+livenessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Periodic probe of container liveness.
+Step will be restarted if the probe fails.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
+ |
+
+
+
+readinessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Periodic probe of container service readiness.
+Step 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
+ |
+
+
+
+startupProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+DeprecatedStartupProbe indicates that the Pod this Step runs 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
+ |
+
+
+
+lifecycle
+
+
+Kubernetes core/v1.Lifecycle
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Actions that the management system should take in response to container lifecycle events.
+Cannot be updated.
+ |
+
+
+
+terminationMessagePath
+
+string
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release and can’t be meaningfully used.
+ |
+
+
+
+terminationMessagePolicy
+
+
+Kubernetes core/v1.TerminationMessagePolicy
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release and can’t be meaningfully used.
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ 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/
+ |
+
+
+
+stdin
+
+bool
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Whether this container should allocate a buffer for stdin in the container runtime. If this
+is not set, reads from stdin in the container will always result in EOF.
+Default is false.
+ |
+
+
+
+stdinOnce
+
+bool
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+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 container 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 container is restarted. If this
+flag is false, a container processes that reads from stdin will never receive an EOF.
+Default is false
+ |
+
+
+
+tty
+
+bool
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Whether this container should allocate a DeprecatedTTY for itself, also requires ‘stdin’ to be true.
+Default is false.
+ |
+
+
+
+script
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceUsage
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+onError
+
+
+OnErrorType
+
+
+ |
+
+ OnError defines the exiting behavior of a container on error
+can be set to [ continue | stopAndFail ]
+ |
+
+
+
+stdoutConfig
+
+
+StepOutputConfig
+
+
+ |
+
+(Optional)
+ Stores configuration for the stdout stream of the step.
+ |
+
+
+
+stderrConfig
+
+
+StepOutputConfig
+
+
+ |
+
+(Optional)
+ Stores configuration for the stderr stream of the step.
+ |
+
+
+
+
StepOutputConfig
+
+
+(Appears on:Step)
+
+
+
StepOutputConfig stores configuration for a step output stream.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+path
+
+string
+
+ |
+
+(Optional)
+ Path to duplicate stdout stream to on container’s local filesystem.
+ |
+
+
+
+
StepState
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
StepState reports the results of running a step in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+ContainerState
+
+
+Kubernetes core/v1.ContainerState
+
+
+ |
+
+
+(Members of ContainerState are embedded into this type.)
+
+ |
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+container
+
+string
+
+ |
+
+ |
+
+
+
+imageID
+
+string
+
+ |
+
+ |
+
+
+
+
StepTemplate
+
+
+(Appears on:TaskSpec)
+
+
+
StepTemplate is a template for a Step
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Deprecated. This field will be removed in a future release.
+Default name for each Step specified as a DNS_LABEL.
+Each Step in a Task must have a unique name.
+Cannot be updated.
+ |
+
+
+
+image
+
+string
+
+ |
+
+(Optional)
+ Default image name to use for each Step.
+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.
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ Entrypoint array. Not executed within a shell.
+The docker 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
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+ports
+
+
+[]Kubernetes core/v1.ContainerPort
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+List of ports to expose from the Step’s container. 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.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ 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 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.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the container.
+Cannot be updated.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+(Optional)
+ Compute Resources required by this Step.
+Cannot be updated.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Volumes to mount into the Step’s filesystem.
+Cannot be updated.
+ |
+
+
+
+volumeDevices
+
+
+[]Kubernetes core/v1.VolumeDevice
+
+
+ |
+
+(Optional)
+ volumeDevices is the list of block devices to be used by the Step.
+ |
+
+
+
+livenessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Periodic probe of container 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
+ |
+
+
+
+readinessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Periodic probe of container 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
+ |
+
+
+
+startupProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+DeprecatedStartupProbe indicates that the Pod 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
+ |
+
+
+
+lifecycle
+
+
+Kubernetes core/v1.Lifecycle
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Actions that the management system should take in response to container lifecycle events.
+Cannot be updated.
+ |
+
+
+
+terminationMessagePath
+
+string
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release and cannot be meaningfully used.
+ |
+
+
+
+terminationMessagePolicy
+
+
+Kubernetes core/v1.TerminationMessagePolicy
+
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release and cannot be meaningfully used.
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+(Optional)
+ 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
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ 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/
+ |
+
+
+
+stdin
+
+bool
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Whether this Step should allocate a buffer for stdin in the container runtime. If this
+is not set, reads from stdin in the Step will always result in EOF.
+Default is false.
+ |
+
+
+
+stdinOnce
+
+bool
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+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 container 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 container is restarted. If this
+flag is false, a container processes that reads from stdin will never receive an EOF.
+Default is false
+ |
+
+
+
+tty
+
+bool
+
+ |
+
+(Optional)
+ Deprecated. This field will be removed in a future release.
+Whether this Step should allocate a DeprecatedTTY for itself, also requires ‘stdin’ to be true.
+Default is false.
+ |
+
+
+
+
TaskKind
+(string
alias)
+
+(Appears on:TaskRef)
+
+
+
TaskKind defines the type of Task used by the pipeline.
+
+
+
+
+Value |
+Description |
+
+
+"ClusterTask" |
+ClusterTaskKind indicates that task type has a cluster scope.
+ |
+
"Task" |
+NamespacedTaskKind indicates that the task type has a namespaced scope.
+ |
+
+
+
TaskModifier
+
+
+
TaskModifier is an interface to be implemented by different PipelineResources
+
+
TaskObject
+
+
+
TaskObject is implemented by Task and ClusterTask
+
+
TaskRef
+
+
+(Appears on:RunSpec, PipelineTask, TaskRunSpec)
+
+
+
TaskRef can be used to refer to a specific instance of a task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ |
+
+
+
+kind
+
+
+TaskKind
+
+
+ |
+
+ TaskKind indicates the kind of the task, namespaced or cluster scoped.
+ |
+
+
+
+apiVersion
+
+string
+
+ |
+
+(Optional)
+ API version of the referent
+ |
+
+
+
+bundle
+
+string
+
+ |
+
+(Optional)
+ Bundle url reference to a Tekton Bundle.
+ |
+
+
+
+ResolverRef
+
+
+ResolverRef
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+
TaskResource
+
+
+(Appears on:TaskResources)
+
+
+
TaskResource defines an input or output Resource declared as a requirement
+by a Task. The Name field will be used to refer to these Resources within
+the Task definition, and when provided as an Input, the Name will be the
+path to the volume mounted containing this Resource as an input (e.g.
+an input Resource named workspace
will be mounted at /workspace
).
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+ResourceDeclaration
+
+
+ResourceDeclaration
+
+
+ |
+
+
+(Members of ResourceDeclaration are embedded into this type.)
+
+ |
+
+
+
+
TaskResourceBinding
+
+
+(Appears on:TaskRunInputs, TaskRunOutputs, TaskRunResources)
+
+
+
TaskResourceBinding points to the PipelineResource that
+will be used for the Task input or output called Name.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+PipelineResourceBinding
+
+
+PipelineResourceBinding
+
+
+ |
+
+
+(Members of PipelineResourceBinding are embedded into this type.)
+
+ |
+
+
+
+paths
+
+[]string
+
+ |
+
+(Optional)
+ Paths will probably be removed in #1284, and then PipelineResourceBinding can be used instead.
+The optional Path field corresponds to a path on disk at which the Resource can be found
+(used when providing the resource via mounted volume, overriding the default logic to fetch the Resource).
+ |
+
+
+
+
TaskResources
+
+
+(Appears on:TaskSpec)
+
+
+
TaskResources allows a Pipeline to declare how its DeclaredPipelineResources
+should be provided to a Task as its inputs and outputs.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+inputs
+
+
+[]TaskResource
+
+
+ |
+
+ Inputs holds the mapping from the PipelineResources declared in
+DeclaredPipelineResources to the input PipelineResources required by the Task.
+ |
+
+
+
+outputs
+
+
+[]TaskResource
+
+
+ |
+
+ Outputs holds the mapping from the PipelineResources declared in
+DeclaredPipelineResources to the input PipelineResources required by the Task.
+ |
+
+
+
+
TaskResult
+
+
+(Appears on:TaskSpec)
+
+
+
TaskResult used to describe the results of a task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+type
+
+
+ResultsType
+
+
+ |
+
+(Optional)
+ Type is the user-specified type of the result. The possible type
+is currently “string” and will support “array” in following work.
+ |
+
+
+
+properties
+
+
+map[string]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.PropertySpec
+
+
+ |
+
+(Optional)
+ Properties is the JSON Schema properties to support key-value pairs results.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a human-readable description of the result
+ |
+
+
+
+
TaskRunDebug
+
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunDebug defines the breakpoint config for a particular TaskRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+breakpoint
+
+[]string
+
+ |
+
+(Optional)
+ |
+
+
+
+
+
+
TaskRunInputs holds the input values that this task was invoked with.
+
+
+
TaskRunOutputs
+
+
+
TaskRunOutputs holds the output values that this task was invoked with.
+
+
+
TaskRunReason
+(string
alias)
+
+
TaskRunReason is an enum used to store all TaskRun reason for
+the Succeeded condition that are controlled by the TaskRun itself. Failure
+reasons that emerge from underlying resources are not included here
+
+
+
+
+Value |
+Description |
+
+
+"TaskRunCancelled" |
+TaskRunReasonCancelled is the reason set when the Taskrun is cancelled by the user
+ |
+
"Failed" |
+TaskRunReasonFailed is the reason set when the TaskRun completed with a failure
+ |
+
"TaskRunImagePullFailed" |
+TaskRunReasonImagePullFailed is the reason set when the step of a task fails due to image not being pulled
+ |
+
"Running" |
+TaskRunReasonRunning is the reason set when the TaskRun is running
+ |
+
"Started" |
+TaskRunReasonStarted is the reason set when the TaskRun has just started
+ |
+
"Succeeded" |
+TaskRunReasonSuccessful is the reason set when the TaskRun completed successfully
+ |
+
"TaskRunTimeout" |
+TaskRunReasonTimedOut is the reason set when the Taskrun has timed out
+ |
+
+
+
TaskRunResources
+
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunResources allows a TaskRun to declare inputs and outputs TaskResourceBinding
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+inputs
+
+
+[]TaskResourceBinding
+
+
+ |
+
+ Inputs holds the inputs resources this task was invoked with
+ |
+
+
+
+outputs
+
+
+[]TaskResourceBinding
+
+
+ |
+
+ Outputs holds the inputs resources this task was invoked with
+ |
+
+
+
+
TaskRunResult
+
+
+(Appears on:TaskRunStatusFields)
+
+
+
TaskRunResult used to describe the results of a task
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name the given name
+ |
+
+
+
+type
+
+
+ResultsType
+
+
+ |
+
+(Optional)
+ Type is the user-specified type of the result. The possible type
+is currently “string” and will support “array” in following work.
+ |
+
+
+
+value
+
+
+ParamValue
+
+
+ |
+
+ Value the given value of the result
+ |
+
+
+
+
TaskRunSidecarOverride
+
+
+(Appears on:PipelineTaskRunSpec, TaskRunSpec)
+
+
+
TaskRunSidecarOverride is used to override the values of a Sidecar in the corresponding Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ The name of the Sidecar to override.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ The resource requirements to apply to the Sidecar.
+ |
+
+
+
+
TaskRunSpec
+
+
+(Appears on:TaskRun)
+
+
+
TaskRunSpec defines the desired state of TaskRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+debug
+
+
+TaskRunDebug
+
+
+ |
+
+(Optional)
+ |
+
+
+
+params
+
+
+[]Param
+
+
+ |
+
+(Optional)
+ |
+
+
+
+resources
+
+
+TaskRunResources
+
+
+ |
+
+(Optional)
+ |
+
+
+
+serviceAccountName
+
+string
+
+ |
+
+(Optional)
+ |
+
+
+
+taskRef
+
+
+TaskRef
+
+
+ |
+
+(Optional)
+ no more than one of the TaskRef and TaskSpec may be specified.
+ |
+
+
+
+taskSpec
+
+
+TaskSpec
+
+
+ |
+
+(Optional)
+ |
+
+
+
+status
+
+
+TaskRunSpecStatus
+
+
+ |
+
+(Optional)
+ Used for cancelling a taskrun (and maybe more later on)
+ |
+
+
+
+statusMessage
+
+
+TaskRunSpecStatusMessage
+
+
+ |
+
+(Optional)
+ Status message for cancellation.
+ |
+
+
+
+timeout
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+(Optional)
+ Time after which the build times out. Defaults to 1 hour.
+Specified build timeout should be less than 24h.
+Refer Go’s ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
+ |
+
+
+
+podTemplate
+
+
+Template
+
+
+ |
+
+ PodTemplate holds pod specific configuration
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceBinding
+
+
+ |
+
+(Optional)
+ Workspaces is a list of WorkspaceBindings from volumes to workspaces.
+ |
+
+
+
+stepOverrides
+
+
+[]TaskRunStepOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Steps in this TaskRun.
+If a field is specified in both a Step and a StepOverride,
+the value from the StepOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+sidecarOverrides
+
+
+[]TaskRunSidecarOverride
+
+
+ |
+
+(Optional)
+ Overrides to apply to Sidecars in this TaskRun.
+If a field is specified in both a Sidecar and a SidecarOverride,
+the value from the SidecarOverride will be used.
+This field is only supported when the alpha feature gate is enabled.
+ |
+
+
+
+computeResources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ Compute resources to use for this TaskRun
+ |
+
+
+
+
TaskRunSpecStatus
+(string
alias)
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunSpecStatus defines the taskrun spec status the user can provide
+
+
TaskRunSpecStatusMessage
+(string
alias)
+
+(Appears on:TaskRunSpec)
+
+
+
TaskRunSpecStatusMessage defines human readable status messages for the TaskRun.
+
+
+
+
+Value |
+Description |
+
+
+"TaskRun cancelled as the PipelineRun it belongs to has been cancelled." |
+TaskRunCancelledByPipelineMsg indicates that the PipelineRun of which this
+TaskRun was a part of has been cancelled.
+ |
+
"TaskRun cancelled as the PipelineRun it belongs to has timed out." |
+TaskRunCancelledByPipelineTimeoutMsg indicates that the TaskRun was cancelled because the PipelineRun running it timed out.
+ |
+
+
+
TaskRunStatus
+
+
+(Appears on:TaskRun, PipelineRunTaskRunStatus, TaskRunStatusFields)
+
+
+
TaskRunStatus defines the observed state of TaskRun
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+Status
+
+
+knative.dev/pkg/apis/duck/v1beta1.Status
+
+
+ |
+
+
+(Members of Status are embedded into this type.)
+
+ |
+
+
+
+TaskRunStatusFields
+
+
+TaskRunStatusFields
+
+
+ |
+
+
+(Members of TaskRunStatusFields are embedded into this type.)
+
+TaskRunStatusFields inlines the status fields.
+ |
+
+
+
+
TaskRunStatusFields
+
+
+(Appears on:TaskRunStatus)
+
+
+
TaskRunStatusFields holds the fields of TaskRun’s status. This is defined
+separately and inlined so that other types can readily consume these fields
+via duck typing.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+podName
+
+string
+
+ |
+
+ PodName is the name of the pod responsible for executing this task’s steps.
+ |
+
+
+
+startTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ StartTime is the time the build is actually started.
+ |
+
+
+
+completionTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ CompletionTime is the time the build completed.
+ |
+
+
+
+steps
+
+
+[]StepState
+
+
+ |
+
+(Optional)
+ Steps describes the state of each build step container.
+ |
+
+
+
+cloudEvents
+
+
+[]CloudEventDelivery
+
+
+ |
+
+(Optional)
+ CloudEvents describe the state of each cloud event requested via a
+CloudEventResource.
+ |
+
+
+
+retriesStatus
+
+
+[]TaskRunStatus
+
+
+ |
+
+(Optional)
+ RetriesStatus contains the history of TaskRunStatus in case of a retry in order to keep record of failures.
+All TaskRunStatus stored in RetriesStatus will have no date within the RetriesStatus as is redundant.
+ |
+
+
+
+resourcesResult
+
+
+[]PipelineResourceResult
+
+
+ |
+
+(Optional)
+ Results from Resources built during the taskRun. currently includes
+the digest of build container images
+ |
+
+
+
+taskResults
+
+
+[]TaskRunResult
+
+
+ |
+
+(Optional)
+ TaskRunResults are the list of results written out by the task’s containers
+ |
+
+
+
+sidecars
+
+
+[]SidecarState
+
+
+ |
+
+ The list has one entry per sidecar in the manifest. Each entry is
+represents the imageid of the corresponding sidecar.
+ |
+
+
+
+taskSpec
+
+
+TaskSpec
+
+
+ |
+
+ TaskSpec contains the Spec from the dereferenced Task definition used to instantiate this TaskRun.
+ |
+
+
+
+
TaskRunStepOverride
+
+
+(Appears on:PipelineTaskRunSpec, TaskRunSpec)
+
+
+
TaskRunStepOverride is used to override the values of a Step in the corresponding Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ The name of the Step to override.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ The resource requirements to apply to the Step.
+ |
+
+
+
+
TaskSpec
+
+
+(Appears on:ClusterTask, Task, EmbeddedTask, TaskRunSpec, TaskRunStatusFields)
+
+
+
TaskSpec defines the desired state of Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+resources
+
+
+TaskResources
+
+
+ |
+
+(Optional)
+ Resources is a list input and output resource to run the task
+Resources are represented in TaskRuns as bindings to instances of
+PipelineResources.
+ |
+
+
+
+params
+
+
+[]ParamSpec
+
+
+ |
+
+(Optional)
+ 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.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is a user-facing description of the task that may be
+used to populate a UI.
+ |
+
+
+
+steps
+
+
+[]Step
+
+
+ |
+
+ Steps are the steps of the build; each step is run sequentially with the
+source mounted into /workspace.
+ |
+
+
+
+volumes
+
+
+[]Kubernetes core/v1.Volume
+
+
+ |
+
+ Volumes is a collection of volumes that are available to mount into the
+steps of the build.
+ |
+
+
+
+stepTemplate
+
+
+StepTemplate
+
+
+ |
+
+ StepTemplate can be used as the basis for all step containers within the
+Task, so that the steps inherit settings on the base container.
+ |
+
+
+
+sidecars
+
+
+[]Sidecar
+
+
+ |
+
+ Sidecars are run alongside the Task’s step containers. They begin before
+the steps start and end after the steps complete.
+ |
+
+
+
+workspaces
+
+
+[]WorkspaceDeclaration
+
+
+ |
+
+ Workspaces are the volumes that this Task requires.
+ |
+
+
+
+results
+
+
+[]TaskResult
+
+
+ |
+
+ Results are values that this Task can output
+ |
+
+
+
+
TimeoutFields
+
+
+(Appears on:PipelineRunSpec)
+
+
+
TimeoutFields allows granular specification of pipeline, task, and finally timeouts
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+pipeline
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+ Pipeline sets the maximum allowed duration for execution of the entire pipeline. The sum of individual timeouts for tasks and finally must not exceed this value.
+ |
+
+
+
+tasks
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+ Tasks sets the maximum allowed duration of this pipeline’s tasks
+ |
+
+
+
+finally
+
+
+Kubernetes meta/v1.Duration
+
+
+ |
+
+ Finally sets the maximum allowed duration of this pipeline’s finally
+ |
+
+
+
+
WhenExpression
+
+
+(Appears on:ChildStatusReference, PipelineRunRunStatus, PipelineRunTaskRunStatus, SkippedTask)
+
+
+
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
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+input
+
+string
+
+ |
+
+ Input is the string for guard checking which can be a static input or an output from a parent Task
+ |
+
+
+
+operator
+
+k8s.io/apimachinery/pkg/selection.Operator
+
+ |
+
+ Operator that represents an Input’s relationship to the values
+ |
+
+
+
+values
+
+[]string
+
+ |
+
+ Values is an array of strings, which is compared against the input, for guard checking
+It must be non-empty
+ |
+
+
+
+
WhenExpressions
+([]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.WhenExpression
alias)
+
+(Appears on:PipelineTask)
+
+
+
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.
+
+
WorkspaceBinding
+
+
+(Appears on:RunSpec, PipelineRunSpec, TaskRunSpec)
+
+
+
WorkspaceBinding maps a Task’s declared workspace to a Volume.
+
+
+
WorkspaceDeclaration
+
+
+(Appears on:TaskSpec)
+
+
+
WorkspaceDeclaration is a declaration of a volume that a Task requires.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name by which you can bind the volume at runtime.
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is an optional human readable description of this volume.
+ |
+
+
+
+mountPath
+
+string
+
+ |
+
+(Optional)
+ MountPath overrides the directory that the volume will be made available at.
+ |
+
+
+
+readOnly
+
+bool
+
+ |
+
+ ReadOnly dictates whether a mounted volume is writable. By default this
+field is false and so mounted volumes are writable.
+ |
+
+
+
+optional
+
+bool
+
+ |
+
+ Optional marks a Workspace as not being required in TaskRuns. By default
+this field is false and so declared workspaces are required.
+ |
+
+
+
+
WorkspacePipelineTaskBinding
+
+
+(Appears on:PipelineTask)
+
+
+
WorkspacePipelineTaskBinding describes how a workspace passed into the pipeline should be
+mapped to a task’s declared workspace.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the workspace as declared by the task
+ |
+
+
+
+workspace
+
+string
+
+ |
+
+(Optional)
+ Workspace is the name of the workspace declared by the pipeline
+ |
+
+
+
+subPath
+
+string
+
+ |
+
+(Optional)
+ 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).
+ |
+
+
+
+
WorkspaceUsage
+
+
+(Appears on:Sidecar, Step)
+
+
+
WorkspaceUsage is used by a Step or Sidecar to declare that it wants isolated access
+to a Workspace defined in a Task.
+
+
+
+
+Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the workspace this Step or Sidecar wants access to.
+ |
+
+
+
+mountPath
+
+string
+
+ |
+
+ 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.
+ |
+
+
+
+
+
+Generated with gen-crd-api-reference-docs
+.
+
diff --git a/pkg/apis/pipeline/v1/openapi_generated.go b/pkg/apis/pipeline/v1/openapi_generated.go
index aeae1ee193f..986151bdb01 100644
--- a/pkg/apis/pipeline/v1/openapi_generated.go
+++ b/pkg/apis/pipeline/v1/openapi_generated.go
@@ -32,23 +32,36 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
return map[string]common.OpenAPIDefinition{
"github.com/tektoncd/pipeline/pkg/apis/pipeline/pod.AffinityAssistantTemplate": schema_pkg_apis_pipeline_pod_AffinityAssistantTemplate(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/pod.Template": schema_pkg_apis_pipeline_pod_Template(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ChildStatusReference": schema_pkg_apis_pipeline_v1_ChildStatusReference(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.EmbeddedTask": schema_pkg_apis_pipeline_v1_EmbeddedTask(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Param": schema_pkg_apis_pipeline_v1_Param(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamSpec": schema_pkg_apis_pipeline_v1_ParamSpec(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue": schema_pkg_apis_pipeline_v1_ParamValue(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Pipeline": schema_pkg_apis_pipeline_v1_Pipeline(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineList": schema_pkg_apis_pipeline_v1_PipelineList(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRef": schema_pkg_apis_pipeline_v1_PipelineRef(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineResult": schema_pkg_apis_pipeline_v1_PipelineResult(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRun": schema_pkg_apis_pipeline_v1_PipelineRun(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunList": schema_pkg_apis_pipeline_v1_PipelineRunList(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunResult": schema_pkg_apis_pipeline_v1_PipelineRunResult(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunRunStatus": schema_pkg_apis_pipeline_v1_PipelineRunRunStatus(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunSpec": schema_pkg_apis_pipeline_v1_PipelineRunSpec(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunStatus": schema_pkg_apis_pipeline_v1_PipelineRunStatus(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunStatusFields": schema_pkg_apis_pipeline_v1_PipelineRunStatusFields(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunTaskRunStatus": schema_pkg_apis_pipeline_v1_PipelineRunTaskRunStatus(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec": schema_pkg_apis_pipeline_v1_PipelineSpec(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTask": schema_pkg_apis_pipeline_v1_PipelineTask(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskMetadata": schema_pkg_apis_pipeline_v1_PipelineTaskMetadata(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskParam": schema_pkg_apis_pipeline_v1_PipelineTaskParam(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskRun": schema_pkg_apis_pipeline_v1_PipelineTaskRun(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskRunSpec": schema_pkg_apis_pipeline_v1_PipelineTaskRunSpec(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineWorkspaceDeclaration": schema_pkg_apis_pipeline_v1_PipelineWorkspaceDeclaration(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PropertySpec": schema_pkg_apis_pipeline_v1_PropertySpec(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ResolverRef": schema_pkg_apis_pipeline_v1_ResolverRef(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ResultRef": schema_pkg_apis_pipeline_v1_ResultRef(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Sidecar": schema_pkg_apis_pipeline_v1_Sidecar(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SidecarState": schema_pkg_apis_pipeline_v1_SidecarState(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SkippedTask": schema_pkg_apis_pipeline_v1_SkippedTask(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Step": schema_pkg_apis_pipeline_v1_Step(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepOutputConfig": schema_pkg_apis_pipeline_v1_StepOutputConfig(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.StepState": schema_pkg_apis_pipeline_v1_StepState(ref),
@@ -68,6 +81,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatusFields": schema_pkg_apis_pipeline_v1_TaskRunStatusFields(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStepOverride": schema_pkg_apis_pipeline_v1_TaskRunStepOverride(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskSpec": schema_pkg_apis_pipeline_v1_TaskSpec(ref),
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TimeoutFields": schema_pkg_apis_pipeline_v1_TimeoutFields(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression": schema_pkg_apis_pipeline_v1_WhenExpression(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WorkspaceBinding": schema_pkg_apis_pipeline_v1_WorkspaceBinding(ref),
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WorkspaceDeclaration": schema_pkg_apis_pipeline_v1_WorkspaceDeclaration(ref),
@@ -340,6 +354,66 @@ func schema_pkg_apis_pipeline_pod_Template(ref common.ReferenceCallback) common.
}
}
+func schema_pkg_apis_pipeline_v1_ChildStatusReference(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "ChildStatusReference is used to point to the statuses of individual TaskRuns and Runs within this PipelineRun.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Name is the name of the TaskRun or Run this is referencing.",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "pipelineTaskName": {
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineTaskName is the name of the PipelineTask this is referencing.",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "whenExpressions": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"},
+ }
+}
+
func schema_pkg_apis_pipeline_v1_EmbeddedTask(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -685,113 +759,702 @@ func schema_pkg_apis_pipeline_v1_Pipeline(ref common.ReferenceCallback) common.O
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
},
},
- "spec": {
+ "spec": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Spec holds the desired state of the Pipeline from the client",
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec"),
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineList(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineList contains a list of Pipeline",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
+ },
+ },
+ "items": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Pipeline"),
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"items"},
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Pipeline", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRef(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRef can be used to refer to a specific instance of a Pipeline.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "API version of the referent",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineResult(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineResult used to describe the results of a pipeline",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Name the given name",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "type": {
+ SchemaProps: spec.SchemaProps{
+ Description: "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: []string{"string"},
+ Format: "",
+ },
+ },
+ "description": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Description is a human-readable description of the result",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "value": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Value the expression used to retrieve the value",
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"),
+ },
+ },
+ },
+ Required: []string{"name", "value"},
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRun(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRun represents a single execution of a Pipeline. PipelineRuns are how the graph of Tasks declared in a Pipeline are executed; they specify inputs to Pipelines such as parameter values and capture operational aspects of the Tasks execution such as service account and tolerations. Creating a PipelineRun creates TaskRuns for Tasks in the referenced Pipeline.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
+ },
+ },
+ "spec": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunSpec"),
+ },
+ },
+ "status": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunStatus"),
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRunList(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunList contains a list of PipelineRun",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "kind": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "apiVersion": {
+ SchemaProps: spec.SchemaProps{
+ Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
+ },
+ },
+ "items": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRun"),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRun", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRunResult(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunResult used to describe the results of a pipeline",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Name is the result's name as declared by the Pipeline",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "value": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Value is the result returned from the execution of this PipelineRun",
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"),
+ },
+ },
+ },
+ Required: []string{"name", "value"},
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRunRunStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunRunStatus contains the name of the PipelineTask for this Run and the Run's Status",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "pipelineTaskName": {
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineTaskName is the name of the PipelineTask.",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "status": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Status is the RunStatus for the corresponding Run",
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/run/v1alpha1.RunStatus"),
+ },
+ },
+ "whenExpressions": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression", "github.com/tektoncd/pipeline/pkg/apis/run/v1alpha1.RunStatus"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRunSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunSpec defines the desired state of PipelineRun",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "pipelineRef": {
+ SchemaProps: spec.SchemaProps{
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRef"),
+ },
+ },
+ "pipelineSpec": {
+ SchemaProps: spec.SchemaProps{
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec"),
+ },
+ },
+ "params": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "Params is a list of parameter names and values.",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Param"),
+ },
+ },
+ },
+ },
+ },
+ "serviceAccountName": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "status": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Used for cancelling a pipelinerun (and maybe more later on)",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "timeouts": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Time after which the Pipeline times out. Currently three keys are accepted in the map pipeline, tasks and finally with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally",
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TimeoutFields"),
+ },
+ },
+ "podTemplate": {
+ SchemaProps: spec.SchemaProps{
+ Description: "PodTemplate holds pod specific configuration",
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/pod.Template"),
+ },
+ },
+ "workspaces": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "Workspaces holds a set of workspace bindings that must match names with those declared in the pipeline.",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WorkspaceBinding"),
+ },
+ },
+ },
+ },
+ },
+ "taskRunSpecs": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "TaskRunSpecs holds a set of runtime specs",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskRunSpec"),
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod.Template", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Param", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRef", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskRunSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TimeoutFields", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WorkspaceBinding"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRunStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunStatus defines the observed state of PipelineRun",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "observedGeneration": {
+ SchemaProps: spec.SchemaProps{
+ Description: "ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.",
+ Type: []string{"integer"},
+ Format: "int64",
+ },
+ },
+ "conditions": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-patch-merge-key": "type",
+ "x-kubernetes-patch-strategy": "merge",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "Conditions the latest available observations of a resource's current state.",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("knative.dev/pkg/apis.Condition"),
+ },
+ },
+ },
+ },
+ },
+ "annotations": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.",
+ Type: []string{"object"},
+ AdditionalProperties: &spec.SchemaOrBool{
+ Allows: true,
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ },
+ },
+ },
+ "startTime": {
+ SchemaProps: spec.SchemaProps{
+ Description: "StartTime is the time the PipelineRun is actually started.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
+ },
+ },
+ "completionTime": {
+ SchemaProps: spec.SchemaProps{
+ Description: "CompletionTime is the time the PipelineRun completed.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
+ },
+ },
+ "results": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "Results are the list of results written out by the pipeline task's containers",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunResult"),
+ },
+ },
+ },
+ },
+ },
+ "pipelineSpec": {
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunSpec contains the exact spec used to instantiate the run",
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec"),
+ },
+ },
+ "skippedTasks": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "list of tasks that were skipped due to when expressions evaluating to false",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SkippedTask"),
+ },
+ },
+ },
+ },
+ },
+ "childReferences": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "list of TaskRun and Run names, PipelineTask names, and API versions/kinds for children of this PipelineRun.",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ChildStatusReference"),
+ },
+ },
+ },
+ },
+ },
+ "finallyStartTime": {
+ SchemaProps: spec.SchemaProps{
+ Description: "FinallyStartTime is when all non-finally tasks have been completed and only finally tasks are being executed.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ChildStatusReference", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SkippedTask", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "knative.dev/pkg/apis.Condition"},
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineRunStatusFields(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineRunStatusFields holds the fields of PipelineRunStatus' status. This is defined separately and inlined so that other types can readily consume these fields via duck typing.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "startTime": {
+ SchemaProps: spec.SchemaProps{
+ Description: "StartTime is the time the PipelineRun is actually started.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
+ },
+ },
+ "completionTime": {
+ SchemaProps: spec.SchemaProps{
+ Description: "CompletionTime is the time the PipelineRun completed.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
+ },
+ },
+ "results": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "Results are the list of results written out by the pipeline task's containers",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunResult"),
+ },
+ },
+ },
+ },
+ },
+ "pipelineSpec": {
SchemaProps: spec.SchemaProps{
- Description: "Spec holds the desired state of the Pipeline from the client",
- Default: map[string]interface{}{},
+ Description: "PipelineRunSpec contains the exact spec used to instantiate the run",
Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec"),
},
},
- },
- },
- },
- Dependencies: []string{
- "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
- }
-}
-
-func schema_pkg_apis_pipeline_v1_PipelineList(ref common.ReferenceCallback) common.OpenAPIDefinition {
- return common.OpenAPIDefinition{
- Schema: spec.Schema{
- SchemaProps: spec.SchemaProps{
- Description: "PipelineList contains a list of Pipeline",
- Type: []string{"object"},
- Properties: map[string]spec.Schema{
- "kind": {
- SchemaProps: spec.SchemaProps{
- Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
- Type: []string{"string"},
- Format: "",
+ "skippedTasks": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
},
- },
- "apiVersion": {
SchemaProps: spec.SchemaProps{
- Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
- Type: []string{"string"},
- Format: "",
+ Description: "list of tasks that were skipped due to when expressions evaluating to false",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SkippedTask"),
+ },
+ },
+ },
},
},
- "metadata": {
- SchemaProps: spec.SchemaProps{
- Default: map[string]interface{}{},
- Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
+ "childReferences": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
},
- },
- "items": {
SchemaProps: spec.SchemaProps{
- Type: []string{"array"},
+ Description: "list of TaskRun and Run names, PipelineTask names, and API versions/kinds for children of this PipelineRun.",
+ Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Default: map[string]interface{}{},
- Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Pipeline"),
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ChildStatusReference"),
},
},
},
},
},
+ "finallyStartTime": {
+ SchemaProps: spec.SchemaProps{
+ Description: "FinallyStartTime is when all non-finally tasks have been completed and only finally tasks are being executed.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"),
+ },
+ },
},
- Required: []string{"items"},
},
},
Dependencies: []string{
- "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Pipeline", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ChildStatusReference", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineRunResult", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineSpec", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.SkippedTask", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"},
}
}
-func schema_pkg_apis_pipeline_v1_PipelineResult(ref common.ReferenceCallback) common.OpenAPIDefinition {
+func schema_pkg_apis_pipeline_v1_PipelineRunTaskRunStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
- Description: "PipelineResult used to describe the results of a pipeline",
+ Description: "PipelineRunTaskRunStatus contains the name of the PipelineTask for this TaskRun and the TaskRun's Status",
Type: []string{"object"},
Properties: map[string]spec.Schema{
- "name": {
+ "pipelineTaskName": {
SchemaProps: spec.SchemaProps{
- Description: "Name the given name",
- Default: "",
+ Description: "PipelineTaskName is the name of the PipelineTask.",
Type: []string{"string"},
Format: "",
},
},
- "type": {
+ "status": {
SchemaProps: spec.SchemaProps{
- Description: "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: []string{"string"},
- Format: "",
+ Description: "Status is the TaskRunStatus for the corresponding TaskRun",
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatus"),
},
},
- "description": {
- SchemaProps: spec.SchemaProps{
- Description: "Description is a human-readable description of the result",
- Default: "",
- Type: []string{"string"},
- Format: "",
+ "whenExpressions": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
},
- },
- "value": {
SchemaProps: spec.SchemaProps{
- Description: "Value the expression used to retrieve the value",
- Default: map[string]interface{}{},
- Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"),
+ Description: "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"),
+ },
+ },
+ },
},
},
},
- Required: []string{"name", "value"},
},
},
Dependencies: []string{
- "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.ParamValue"},
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStatus", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"},
}
}
@@ -1121,6 +1784,104 @@ func schema_pkg_apis_pipeline_v1_PipelineTaskParam(ref common.ReferenceCallback)
}
}
+func schema_pkg_apis_pipeline_v1_PipelineTaskRun(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineTaskRun reports the results of running a step in the Task. Each task has the potential to succeed or fail (based on the exit code) and produces logs.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ },
+ },
+ },
+ }
+}
+
+func schema_pkg_apis_pipeline_v1_PipelineTaskRunSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "PipelineTaskRunSpec can be used to configure specific specs for a concrete Task",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "pipelineTaskName": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "serviceAccountName": {
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "podTemplate": {
+ SchemaProps: spec.SchemaProps{
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/pod.Template"),
+ },
+ },
+ "stepOverrides": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStepOverride"),
+ },
+ },
+ },
+ },
+ },
+ "sidecarOverrides": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunSidecarOverride"),
+ },
+ },
+ },
+ },
+ },
+ "metadata": {
+ SchemaProps: spec.SchemaProps{
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskMetadata"),
+ },
+ },
+ "computeResources": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Compute resources to use for this TaskRun",
+ Ref: ref("k8s.io/api/core/v1.ResourceRequirements"),
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod.Template", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.PipelineTaskMetadata", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunSidecarOverride", "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.TaskRunStepOverride", "k8s.io/api/core/v1.ResourceRequirements"},
+ }
+}
+
func schema_pkg_apis_pipeline_v1_PipelineWorkspaceDeclaration(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -1600,6 +2361,57 @@ func schema_pkg_apis_pipeline_v1_SidecarState(ref common.ReferenceCallback) comm
}
}
+func schema_pkg_apis_pipeline_v1_SkippedTask(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "SkippedTask is used to describe the Tasks that were skipped due to their When Expressions evaluating to False. This is a struct because we are looking into including more details about the When Expressions that caused this Task to be skipped.",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "name": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Name is the Pipeline Task name",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "reason": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Reason is the cause of the PipelineTask being skipped.",
+ Default: "",
+ Type: []string{"string"},
+ Format: "",
+ },
+ },
+ "whenExpressions": {
+ VendorExtensible: spec.VendorExtensible{
+ Extensions: spec.Extensions{
+ "x-kubernetes-list-type": "atomic",
+ },
+ },
+ SchemaProps: spec.SchemaProps{
+ Description: "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ Type: []string{"array"},
+ Items: &spec.SchemaOrArray{
+ Schema: &spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Default: map[string]interface{}{},
+ Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"),
+ },
+ },
+ },
+ },
+ },
+ },
+ Required: []string{"name", "reason"},
+ },
+ },
+ Dependencies: []string{
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.WhenExpression"},
+ }
+}
+
func schema_pkg_apis_pipeline_v1_Step(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -3078,6 +3890,39 @@ func schema_pkg_apis_pipeline_v1_TaskSpec(ref common.ReferenceCallback) common.O
}
}
+func schema_pkg_apis_pipeline_v1_TimeoutFields(ref common.ReferenceCallback) common.OpenAPIDefinition {
+ return common.OpenAPIDefinition{
+ Schema: spec.Schema{
+ SchemaProps: spec.SchemaProps{
+ Description: "TimeoutFields allows granular specification of pipeline, task, and finally timeouts",
+ Type: []string{"object"},
+ Properties: map[string]spec.Schema{
+ "pipeline": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Pipeline sets the maximum allowed duration for execution of the entire pipeline. The sum of individual timeouts for tasks and finally must not exceed this value.",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"),
+ },
+ },
+ "tasks": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Tasks sets the maximum allowed duration of this pipeline's tasks",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"),
+ },
+ },
+ "finally": {
+ SchemaProps: spec.SchemaProps{
+ Description: "Finally sets the maximum allowed duration of this pipeline's finally",
+ Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"),
+ },
+ },
+ },
+ },
+ },
+ Dependencies: []string{
+ "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"},
+ }
+}
+
func schema_pkg_apis_pipeline_v1_WhenExpression(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
diff --git a/pkg/apis/pipeline/v1/pipelineref_types.go b/pkg/apis/pipeline/v1/pipelineref_types.go
new file mode 100644
index 00000000000..631c5646d34
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelineref_types.go
@@ -0,0 +1,32 @@
+/*
+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
+
+// PipelineRef can be used to refer to a specific instance of a Pipeline.
+type PipelineRef struct {
+ // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
+ Name string `json:"name,omitempty"`
+ // API version of the referent
+ // +optional
+ APIVersion string `json:"apiVersion,omitempty"`
+
+ // ResolverRef allows referencing a Pipeline in a remote location
+ // like a git repo. This field is only supported when the alpha
+ // feature gate is enabled.
+ // +optional
+ ResolverRef `json:",omitempty"`
+}
diff --git a/pkg/apis/pipeline/v1/pipelineref_validation.go b/pkg/apis/pipeline/v1/pipelineref_validation.go
new file mode 100644
index 00000000000..8fd971828cf
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelineref_validation.go
@@ -0,0 +1,44 @@
+/*
+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
+
+import (
+ "context"
+
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ "github.com/tektoncd/pipeline/pkg/apis/version"
+ "knative.dev/pkg/apis"
+)
+
+// Validate ensures that a supplied PipelineRef field is populated
+// correctly. No errors are returned for a nil PipelineRef.
+func (ref *PipelineRef) Validate(ctx context.Context) (errs *apis.FieldError) {
+ if ref == nil {
+ return
+ }
+
+ switch {
+ case ref.Resolver != "":
+ errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "resolver", config.AlphaAPIFields).ViaField("resolver"))
+ if ref.Name != "" {
+ errs = errs.Also(apis.ErrMultipleOneOf("name", "resolver"))
+ }
+ case ref.Name == "":
+ errs = errs.Also(apis.ErrMissingField("name"))
+ }
+ return
+}
diff --git a/pkg/apis/pipeline/v1/pipelineref_validation_test.go b/pkg/apis/pipeline/v1/pipelineref_validation_test.go
new file mode 100644
index 00000000000..e97bd2fb603
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelineref_validation_test.go
@@ -0,0 +1,99 @@
+/*
+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_test
+
+import (
+ "context"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ "github.com/tektoncd/pipeline/test/diff"
+ "knative.dev/pkg/apis"
+)
+
+func TestPipelineRef_Invalid(t *testing.T) {
+ tests := []struct {
+ name string
+ ref *v1.PipelineRef
+ wantErr *apis.FieldError
+ withContext func(context.Context) context.Context
+ }{{
+ name: "pipelineRef without Pipeline Name",
+ ref: &v1.PipelineRef{},
+ wantErr: apis.ErrMissingField("name"),
+ }, {
+ name: "pipelineref resolver disallowed without alpha feature gate",
+ ref: &v1.PipelineRef{
+ ResolverRef: v1.ResolverRef{
+ Resolver: "foo",
+ },
+ },
+ wantErr: apis.ErrGeneric("resolver requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""),
+ }, {
+ name: "pipelineref resolver disallowed in conjunction with pipelineref name",
+ ref: &v1.PipelineRef{
+ Name: "foo",
+ ResolverRef: v1.ResolverRef{
+ Resolver: "bar",
+ },
+ },
+ wantErr: apis.ErrMultipleOneOf("name", "resolver"),
+ withContext: config.EnableAlphaAPIFields,
+ }}
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ ctx := context.Background()
+ if tc.withContext != nil {
+ ctx = tc.withContext(ctx)
+ }
+ err := tc.ref.Validate(ctx)
+ if d := cmp.Diff(tc.wantErr.Error(), err.Error()); d != "" {
+ t.Error(diff.PrintWantGot(d))
+ }
+ })
+ }
+}
+
+func TestPipelineRef_Valid(t *testing.T) {
+ tests := []struct {
+ name string
+ ref *v1.PipelineRef
+ wc func(context.Context) context.Context
+ }{{
+ name: "no pipelineRef",
+ ref: nil,
+ }, {
+ name: "alpha feature: valid resolver",
+ ref: &v1.PipelineRef{ResolverRef: v1.ResolverRef{Resolver: "git"}},
+ wc: config.EnableAlphaAPIFields,
+ }}
+
+ for _, ts := range tests {
+ t.Run(ts.name, func(t *testing.T) {
+ ctx := context.Background()
+ if ts.wc != nil {
+ ctx = ts.wc(ctx)
+ }
+ if err := ts.ref.Validate(ctx); err != nil {
+ t.Error(err)
+ }
+ })
+ }
+}
diff --git a/pkg/apis/pipeline/v1/pipelinerun_defaults.go b/pkg/apis/pipeline/v1/pipelinerun_defaults.go
new file mode 100644
index 00000000000..486985d010c
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelinerun_defaults.go
@@ -0,0 +1,55 @@
+/*
+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
+
+import (
+ "context"
+ "time"
+
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "knative.dev/pkg/apis"
+)
+
+var _ apis.Defaultable = (*PipelineRun)(nil)
+
+// SetDefaults implements apis.Defaultable
+func (pr *PipelineRun) SetDefaults(ctx context.Context) {
+ pr.Spec.SetDefaults(ctx)
+}
+
+// SetDefaults implements apis.Defaultable
+func (prs *PipelineRunSpec) SetDefaults(ctx context.Context) {
+ cfg := config.FromContextOrDefaults(ctx)
+
+ if prs.Timeouts != nil && prs.Timeouts.Pipeline == nil {
+ prs.Timeouts.Pipeline = &metav1.Duration{Duration: time.Duration(cfg.Defaults.DefaultTimeoutMinutes) * time.Minute}
+ }
+
+ defaultSA := cfg.Defaults.DefaultServiceAccount
+ if prs.ServiceAccountName == "" && defaultSA != "" {
+ prs.ServiceAccountName = defaultSA
+ }
+
+ defaultPodTemplate := cfg.Defaults.DefaultPodTemplate
+ prs.PodTemplate = pod.MergePodTemplateWithDefault(prs.PodTemplate, defaultPodTemplate)
+
+ if prs.PipelineSpec != nil {
+ prs.PipelineSpec.SetDefaults(ctx)
+ }
+}
diff --git a/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go b/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go
new file mode 100644
index 00000000000..a0275bd856f
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelinerun_defaults_test.go
@@ -0,0 +1,301 @@
+/*
+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_test
+
+import (
+ "context"
+ "testing"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/google/go-cmp/cmp/cmpopts"
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ "github.com/tektoncd/pipeline/test/diff"
+ corev1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ logtesting "knative.dev/pkg/logging/testing"
+)
+
+func TestPipelineRunSpec_SetDefaults(t *testing.T) {
+ cases := []struct {
+ desc string
+ prs *v1.PipelineRunSpec
+ want *v1.PipelineRunSpec
+ }{
+ {
+ desc: "pod template is nil",
+ prs: &v1.PipelineRunSpec{},
+ want: &v1.PipelineRunSpec{
+ ServiceAccountName: config.DefaultServiceAccountValue,
+ },
+ },
+ {
+ desc: "pod template is not nil",
+ prs: &v1.PipelineRunSpec{
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label": "value",
+ },
+ },
+ },
+ want: &v1.PipelineRunSpec{
+ ServiceAccountName: config.DefaultServiceAccountValue,
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label": "value",
+ },
+ },
+ },
+ },
+ }
+ for _, tc := range cases {
+ t.Run(tc.desc, func(t *testing.T) {
+ ctx := context.Background()
+ tc.prs.SetDefaults(ctx)
+
+ sortParamSpecs := func(x, y v1.ParamSpec) bool {
+ return x.Name < y.Name
+ }
+ sortParams := func(x, y v1.Param) bool {
+ return x.Name < y.Name
+ }
+ sortTasks := func(x, y v1.PipelineTask) bool {
+ return x.Name < y.Name
+ }
+ if d := cmp.Diff(tc.want, tc.prs, cmpopts.SortSlices(sortParamSpecs), cmpopts.SortSlices(sortParams), cmpopts.SortSlices(sortTasks)); d != "" {
+ t.Errorf("Mismatch of PipelineRunSpec %s", diff.PrintWantGot(d))
+ }
+ })
+ }
+}
+
+func TestPipelineRunDefaulting(t *testing.T) {
+ tests := []struct {
+ name string
+ in *v1.PipelineRun
+ want *v1.PipelineRun
+ wc func(context.Context) context.Context
+ }{{
+ name: "empty no context",
+ in: &v1.PipelineRun{},
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ ServiceAccountName: config.DefaultServiceAccountValue,
+ },
+ },
+ }, {
+ name: "Embedded PipelineSpec default",
+ in: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineSpec: &v1.PipelineSpec{
+ Params: []v1.ParamSpec{{
+ Name: "foo",
+ }},
+ },
+ },
+ },
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineSpec: &v1.PipelineSpec{
+ Params: []v1.ParamSpec{{
+ Name: "foo",
+ Type: "string",
+ }},
+ },
+ ServiceAccountName: config.DefaultServiceAccountValue,
+ },
+ },
+ }, {
+ name: "PipelineRef default config context",
+ in: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ },
+ },
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ ServiceAccountName: config.DefaultServiceAccountValue,
+ },
+ },
+ wc: func(ctx context.Context) context.Context {
+ s := config.NewStore(logtesting.TestLogger(t))
+ s.OnConfigChanged(&corev1.ConfigMap{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: config.GetDefaultsConfigName(),
+ },
+ Data: map[string]string{},
+ })
+ return s.ToContext(ctx)
+ },
+ }, {
+ name: "PipelineRef default config context with sa",
+ in: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ },
+ },
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ ServiceAccountName: "tekton",
+ },
+ },
+ wc: func(ctx context.Context) context.Context {
+ s := config.NewStore(logtesting.TestLogger(t))
+ s.OnConfigChanged(&corev1.ConfigMap{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: config.GetDefaultsConfigName(),
+ },
+ Data: map[string]string{
+ "default-timeout-minutes": "5",
+ "default-service-account": "tekton",
+ },
+ })
+ return s.ToContext(ctx)
+ },
+ }, {
+ name: "PipelineRef pod template is coming from default config pod template",
+ in: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ },
+ },
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ ServiceAccountName: "tekton",
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label": "value",
+ },
+ },
+ },
+ },
+ wc: func(ctx context.Context) context.Context {
+ s := config.NewStore(logtesting.TestLogger(t))
+ s.OnConfigChanged(&corev1.ConfigMap{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: config.GetDefaultsConfigName(),
+ },
+ Data: map[string]string{
+ "default-timeout-minutes": "5",
+ "default-service-account": "tekton",
+ "default-pod-template": "nodeSelector: { 'label': 'value' }",
+ },
+ })
+ return s.ToContext(ctx)
+ },
+ }, {
+ name: "PipelineRef pod template nodeselector takes precedence over default config pod template nodeselector",
+ in: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label2": "value2",
+ },
+ },
+ },
+ },
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ ServiceAccountName: "tekton",
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label2": "value2",
+ },
+ },
+ },
+ },
+ wc: func(ctx context.Context) context.Context {
+ s := config.NewStore(logtesting.TestLogger(t))
+ s.OnConfigChanged(&corev1.ConfigMap{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: config.GetDefaultsConfigName(),
+ },
+ Data: map[string]string{
+ "default-timeout-minutes": "5",
+ "default-service-account": "tekton",
+ "default-pod-template": "nodeSelector: { 'label': 'value' }",
+ },
+ })
+ return s.ToContext(ctx)
+ },
+ }, {
+ name: "PipelineRef pod template merges non competing fields with default config pod template",
+ in: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label2": "value2",
+ },
+ SecurityContext: &corev1.PodSecurityContext{
+ RunAsNonRoot: &ttrue,
+ },
+ HostNetwork: false,
+ },
+ },
+ },
+ want: &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ ServiceAccountName: "tekton",
+ PodTemplate: &pod.Template{
+ NodeSelector: map[string]string{
+ "label2": "value2",
+ },
+ SecurityContext: &corev1.PodSecurityContext{
+ RunAsNonRoot: &ttrue,
+ },
+ HostNetwork: true,
+ },
+ },
+ },
+ wc: func(ctx context.Context) context.Context {
+ s := config.NewStore(logtesting.TestLogger(t))
+ s.OnConfigChanged(&corev1.ConfigMap{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: config.GetDefaultsConfigName(),
+ },
+ Data: map[string]string{
+ "default-timeout-minutes": "5",
+ "default-service-account": "tekton",
+ "default-pod-template": "nodeSelector: { 'label': 'value' }\nhostNetwork: true",
+ },
+ })
+ return s.ToContext(ctx)
+ },
+ }}
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ got := tc.in
+ ctx := context.Background()
+ if tc.wc != nil {
+ ctx = tc.wc(ctx)
+ }
+ got.SetDefaults(ctx)
+ if !cmp.Equal(got, tc.want, ignoreUnexportedResources) {
+ d := cmp.Diff(got, tc.want, ignoreUnexportedResources)
+ t.Errorf("SetDefaults %s", diff.PrintWantGot(d))
+ }
+ })
+ }
+}
diff --git a/pkg/apis/pipeline/v1/pipelinerun_types.go b/pkg/apis/pipeline/v1/pipelinerun_types.go
new file mode 100644
index 00000000000..dc3cbf1b068
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelinerun_types.go
@@ -0,0 +1,565 @@
+/*
+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
+
+import (
+ "context"
+ "time"
+
+ corev1 "k8s.io/api/core/v1"
+ "k8s.io/apimachinery/pkg/runtime"
+
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ apisconfig "github.com/tektoncd/pipeline/pkg/apis/config"
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline"
+ pod "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
+ runv1alpha1 "github.com/tektoncd/pipeline/pkg/apis/run/v1alpha1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/types"
+ "k8s.io/apimachinery/pkg/util/clock"
+ "knative.dev/pkg/apis"
+ duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"
+)
+
+// +genclient
+// +genreconciler:krshapedlogic=false
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// PipelineRun represents a single execution of a Pipeline. PipelineRuns are how
+// the graph of Tasks declared in a Pipeline are executed; they specify inputs
+// to Pipelines such as parameter values and capture operational aspects of the
+// Tasks execution such as service account and tolerations. Creating a
+// PipelineRun creates TaskRuns for Tasks in the referenced Pipeline.
+//
+// +k8s:openapi-gen=true
+type PipelineRun struct {
+ metav1.TypeMeta `json:",inline"`
+ // +optional
+ metav1.ObjectMeta `json:"metadata,omitempty"`
+
+ // +optional
+ Spec PipelineRunSpec `json:"spec,omitempty"`
+ // +optional
+ Status PipelineRunStatus `json:"status,omitempty"`
+}
+
+// GetName Returns the name of the PipelineRun
+func (pr *PipelineRun) GetName() string {
+ return pr.ObjectMeta.GetName()
+}
+
+// GetStatusCondition returns the task run status as a ConditionAccessor
+func (pr *PipelineRun) GetStatusCondition() apis.ConditionAccessor {
+ return &pr.Status
+}
+
+// GetGroupVersionKind implements kmeta.OwnerRefable.
+func (*PipelineRun) GetGroupVersionKind() schema.GroupVersionKind {
+ return SchemeGroupVersion.WithKind(pipeline.PipelineRunControllerName)
+}
+
+// IsDone returns true if the PipelineRun's status indicates that it is done.
+func (pr *PipelineRun) IsDone() bool {
+ return !pr.Status.GetCondition(apis.ConditionSucceeded).IsUnknown()
+}
+
+// HasStarted function check whether pipelinerun has valid start time set in its status
+func (pr *PipelineRun) HasStarted() bool {
+ return pr.Status.StartTime != nil && !pr.Status.StartTime.IsZero()
+}
+
+// IsCancelled returns true if the PipelineRun's spec status is set to Cancelled state
+func (pr *PipelineRun) IsCancelled() bool {
+ return pr.Spec.Status == PipelineRunSpecStatusCancelled
+}
+
+// IsGracefullyCancelled returns true if the PipelineRun's spec status is set to CancelledRunFinally state
+func (pr *PipelineRun) IsGracefullyCancelled() bool {
+ return pr.Spec.Status == PipelineRunSpecStatusCancelledRunFinally
+}
+
+// IsGracefullyStopped returns true if the PipelineRun's spec status is set to StoppedRunFinally state
+func (pr *PipelineRun) IsGracefullyStopped() bool {
+ return pr.Spec.Status == PipelineRunSpecStatusStoppedRunFinally
+}
+
+// PipelineTimeout returns the the applicable timeout for the PipelineRun
+func (pr *PipelineRun) PipelineTimeout(ctx context.Context) time.Duration {
+ if pr.Spec.Timeouts != nil && pr.Spec.Timeouts.Pipeline != nil {
+ return pr.Spec.Timeouts.Pipeline.Duration
+ }
+ return time.Duration(config.FromContextOrDefaults(ctx).Defaults.DefaultTimeoutMinutes) * time.Minute
+}
+
+// TasksTimeout returns the the tasks timeout for the PipelineRun, if set,
+// or the tasks timeout computed from the Pipeline and Finally timeouts, if those are set.
+func (pr *PipelineRun) TasksTimeout() *metav1.Duration {
+ t := pr.Spec.Timeouts
+ if t == nil {
+ return nil
+ }
+ if t.Tasks != nil {
+ return t.Tasks
+ }
+ if t.Pipeline != nil && t.Finally != nil {
+ if t.Pipeline.Duration == apisconfig.NoTimeoutDuration || t.Finally.Duration == apisconfig.NoTimeoutDuration {
+ return nil
+ }
+ return &metav1.Duration{Duration: (t.Pipeline.Duration - t.Finally.Duration)}
+ }
+ return nil
+}
+
+// FinallyTimeout returns the the finally timeout for the PipelineRun, if set,
+// or the finally timeout computed from the Pipeline and Tasks timeouts, if those are set.
+func (pr *PipelineRun) FinallyTimeout() *metav1.Duration {
+ t := pr.Spec.Timeouts
+ if t == nil {
+ return nil
+ }
+ if t.Finally != nil {
+ return t.Finally
+ }
+ if t.Pipeline != nil && t.Tasks != nil {
+ if t.Pipeline.Duration == apisconfig.NoTimeoutDuration || t.Tasks.Duration == apisconfig.NoTimeoutDuration {
+ return nil
+ }
+ return &metav1.Duration{Duration: (t.Pipeline.Duration - t.Tasks.Duration)}
+ }
+ return nil
+}
+
+// IsPending returns true if the PipelineRun's spec status is set to Pending state
+func (pr *PipelineRun) IsPending() bool {
+ return pr.Spec.Status == PipelineRunSpecStatusPending
+}
+
+// GetNamespacedName returns a k8s namespaced name that identifies this PipelineRun
+func (pr *PipelineRun) GetNamespacedName() types.NamespacedName {
+ return types.NamespacedName{Namespace: pr.Namespace, Name: pr.Name}
+}
+
+// HasTimedOut returns true if a pipelinerun has exceeded its spec.Timeout based on its status.Timeout
+func (pr *PipelineRun) HasTimedOut(ctx context.Context, c clock.PassiveClock) bool {
+ timeout := pr.PipelineTimeout(ctx)
+ startTime := pr.Status.StartTime
+
+ if !startTime.IsZero() {
+ if timeout == config.NoTimeoutDuration {
+ return false
+ }
+ runtime := c.Since(startTime.Time)
+ if runtime > timeout {
+ return true
+ }
+ }
+ return false
+}
+
+// HaveTasksTimedOut returns true if a pipelinerun has exceeded its spec.Timeouts.Tasks
+func (pr *PipelineRun) HaveTasksTimedOut(ctx context.Context, c clock.PassiveClock) bool {
+ timeout := pr.TasksTimeout()
+ startTime := pr.Status.StartTime
+
+ if !startTime.IsZero() && timeout != nil {
+ if timeout.Duration == config.NoTimeoutDuration {
+ return false
+ }
+ runtime := c.Since(startTime.Time)
+ if runtime > timeout.Duration {
+ return true
+ }
+ }
+ return false
+}
+
+// HasFinallyTimedOut returns true if a pipelinerun has exceeded its spec.Timeouts.Finally, based on status.FinallyStartTime
+func (pr *PipelineRun) HasFinallyTimedOut(ctx context.Context, c clock.PassiveClock) bool {
+ timeout := pr.FinallyTimeout()
+ startTime := pr.Status.FinallyStartTime
+
+ if startTime != nil && !startTime.IsZero() && timeout != nil {
+ if timeout.Duration == config.NoTimeoutDuration {
+ return false
+ }
+ runtime := c.Since(startTime.Time)
+ if runtime > timeout.Duration {
+ return true
+ }
+ }
+ return false
+}
+
+// HasVolumeClaimTemplate returns true if PipelineRun contains volumeClaimTemplates that is
+// used for creating PersistentVolumeClaims with an OwnerReference for each run
+func (pr *PipelineRun) HasVolumeClaimTemplate() bool {
+ for _, ws := range pr.Spec.Workspaces {
+ if ws.VolumeClaimTemplate != nil {
+ return true
+ }
+ }
+ return false
+}
+
+// PipelineRunSpec defines the desired state of PipelineRun
+type PipelineRunSpec struct {
+ // +optional
+ PipelineRef *PipelineRef `json:"pipelineRef,omitempty"`
+ // +optional
+ PipelineSpec *PipelineSpec `json:"pipelineSpec,omitempty"`
+ // Params is a list of parameter names and values.
+ // +listType=atomic
+ Params []Param `json:"params,omitempty"`
+ // +optional
+ ServiceAccountName string `json:"serviceAccountName,omitempty"`
+
+ // Used for cancelling a pipelinerun (and maybe more later on)
+ // +optional
+ Status PipelineRunSpecStatus `json:"status,omitempty"`
+ // Time after which the Pipeline times out.
+ // Currently three keys are accepted in the map
+ // pipeline, tasks and finally
+ // with Timeouts.pipeline >= Timeouts.tasks + Timeouts.finally
+ // +optional
+ Timeouts *TimeoutFields `json:"timeouts,omitempty"`
+
+ // PodTemplate holds pod specific configuration
+ PodTemplate *pod.PodTemplate `json:"podTemplate,omitempty"`
+ // Workspaces holds a set of workspace bindings that must match names
+ // with those declared in the pipeline.
+ // +optional
+ // +listType=atomic
+ Workspaces []WorkspaceBinding `json:"workspaces,omitempty"`
+ // TaskRunSpecs holds a set of runtime specs
+ // +optional
+ // +listType=atomic
+ TaskRunSpecs []PipelineTaskRunSpec `json:"taskRunSpecs,omitempty"`
+}
+
+// TimeoutFields allows granular specification of pipeline, task, and finally timeouts
+type TimeoutFields struct {
+ // Pipeline sets the maximum allowed duration for execution of the entire pipeline. The sum of individual timeouts for tasks and finally must not exceed this value.
+ Pipeline *metav1.Duration `json:"pipeline,omitempty"`
+ // Tasks sets the maximum allowed duration of this pipeline's tasks
+ Tasks *metav1.Duration `json:"tasks,omitempty"`
+ // Finally sets the maximum allowed duration of this pipeline's finally
+ Finally *metav1.Duration `json:"finally,omitempty"`
+}
+
+// PipelineRunSpecStatus defines the pipelinerun spec status the user can provide
+type PipelineRunSpecStatus string
+
+const (
+ // PipelineRunSpecStatusCancelled indicates that the user wants to cancel the task,
+ // if not already cancelled or terminated
+ PipelineRunSpecStatusCancelled = "Cancelled"
+
+ // PipelineRunSpecStatusCancelledRunFinally indicates that the user wants to cancel the pipeline run,
+ // if not already cancelled or terminated, but ensure finally is run normally
+ PipelineRunSpecStatusCancelledRunFinally = "CancelledRunFinally"
+
+ // PipelineRunSpecStatusStoppedRunFinally indicates that the user wants to stop the pipeline run,
+ // wait for already running tasks to be completed and run finally
+ // if not already cancelled or terminated
+ PipelineRunSpecStatusStoppedRunFinally = "StoppedRunFinally"
+
+ // PipelineRunSpecStatusPending indicates that the user wants to postpone starting a PipelineRun
+ // until some condition is met
+ PipelineRunSpecStatusPending = "PipelineRunPending"
+)
+
+// PipelineRunStatus defines the observed state of PipelineRun
+type PipelineRunStatus struct {
+ duckv1beta1.Status `json:",inline"`
+
+ // PipelineRunStatusFields inlines the status fields.
+ PipelineRunStatusFields `json:",inline"`
+}
+
+// PipelineRunReason represents a reason for the pipeline run "Succeeded" condition
+type PipelineRunReason string
+
+const (
+ // PipelineRunReasonStarted is the reason set when the PipelineRun has just started
+ PipelineRunReasonStarted PipelineRunReason = "Started"
+ // PipelineRunReasonRunning is the reason set when the PipelineRun is running
+ PipelineRunReasonRunning PipelineRunReason = "Running"
+ // PipelineRunReasonSuccessful is the reason set when the PipelineRun completed successfully
+ PipelineRunReasonSuccessful PipelineRunReason = "Succeeded"
+ // PipelineRunReasonCompleted is the reason set when the PipelineRun completed successfully with one or more skipped Tasks
+ PipelineRunReasonCompleted PipelineRunReason = "Completed"
+ // PipelineRunReasonFailed is the reason set when the PipelineRun completed with a failure
+ PipelineRunReasonFailed PipelineRunReason = "Failed"
+ // PipelineRunReasonCancelled is the reason set when the PipelineRun cancelled by the user
+ // This reason may be found with a corev1.ConditionFalse status, if the cancellation was processed successfully
+ // This reason may be found with a corev1.ConditionUnknown status, if the cancellation is being processed or failed
+ PipelineRunReasonCancelled PipelineRunReason = "Cancelled"
+ // PipelineRunReasonPending is the reason set when the PipelineRun is in the pending state
+ PipelineRunReasonPending PipelineRunReason = "PipelineRunPending"
+ // PipelineRunReasonTimedOut is the reason set when the PipelineRun has timed out
+ PipelineRunReasonTimedOut PipelineRunReason = "PipelineRunTimeout"
+ // PipelineRunReasonStopping indicates that no new Tasks will be scheduled by the controller, and the
+ // pipeline will stop once all running tasks complete their work
+ PipelineRunReasonStopping PipelineRunReason = "PipelineRunStopping"
+ // PipelineRunReasonCancelledRunningFinally indicates that pipeline has been gracefully cancelled
+ // and no new Tasks will be scheduled by the controller, but final tasks are now running
+ PipelineRunReasonCancelledRunningFinally PipelineRunReason = "CancelledRunningFinally"
+ // PipelineRunReasonStoppedRunningFinally indicates that pipeline has been gracefully stopped
+ // and no new Tasks will be scheduled by the controller, but final tasks are now running
+ PipelineRunReasonStoppedRunningFinally PipelineRunReason = "StoppedRunningFinally"
+)
+
+func (t PipelineRunReason) String() string {
+ return string(t)
+}
+
+var pipelineRunCondSet = apis.NewBatchConditionSet()
+
+// GetCondition returns the Condition matching the given type.
+func (pr *PipelineRunStatus) GetCondition(t apis.ConditionType) *apis.Condition {
+ return pipelineRunCondSet.Manage(pr).GetCondition(t)
+}
+
+// InitializeConditions will set all conditions in pipelineRunCondSet to unknown for the PipelineRun
+// and set the started time to the current time
+func (pr *PipelineRunStatus) InitializeConditions(c clock.PassiveClock) {
+ started := false
+ if pr.StartTime.IsZero() {
+ pr.StartTime = &metav1.Time{Time: c.Now()}
+ started = true
+ }
+ conditionManager := pipelineRunCondSet.Manage(pr)
+ conditionManager.InitializeConditions()
+ // Ensure the started reason is set for the "Succeeded" condition
+ if started {
+ initialCondition := conditionManager.GetCondition(apis.ConditionSucceeded)
+ initialCondition.Reason = PipelineRunReasonStarted.String()
+ conditionManager.SetCondition(*initialCondition)
+ }
+}
+
+// SetCondition sets the condition, unsetting previous conditions with the same
+// type as necessary.
+func (pr *PipelineRunStatus) SetCondition(newCond *apis.Condition) {
+ if newCond != nil {
+ pipelineRunCondSet.Manage(pr).SetCondition(*newCond)
+ }
+}
+
+// MarkSucceeded changes the Succeeded condition to True with the provided reason and message.
+func (pr *PipelineRunStatus) MarkSucceeded(reason, messageFormat string, messageA ...interface{}) {
+ pipelineRunCondSet.Manage(pr).MarkTrueWithReason(apis.ConditionSucceeded, reason, messageFormat, messageA...)
+ succeeded := pr.GetCondition(apis.ConditionSucceeded)
+ pr.CompletionTime = &succeeded.LastTransitionTime.Inner
+}
+
+// MarkFailed changes the Succeeded condition to False with the provided reason and message.
+func (pr *PipelineRunStatus) MarkFailed(reason, messageFormat string, messageA ...interface{}) {
+ pipelineRunCondSet.Manage(pr).MarkFalse(apis.ConditionSucceeded, reason, messageFormat, messageA...)
+ succeeded := pr.GetCondition(apis.ConditionSucceeded)
+ pr.CompletionTime = &succeeded.LastTransitionTime.Inner
+}
+
+// MarkRunning changes the Succeeded condition to Unknown with the provided reason and message.
+func (pr *PipelineRunStatus) MarkRunning(reason, messageFormat string, messageA ...interface{}) {
+ pipelineRunCondSet.Manage(pr).MarkUnknown(apis.ConditionSucceeded, reason, messageFormat, messageA...)
+}
+
+// ChildStatusReference is used to point to the statuses of individual TaskRuns and Runs within this PipelineRun.
+type ChildStatusReference struct {
+ runtime.TypeMeta `json:",inline"`
+ // Name is the name of the TaskRun or Run this is referencing.
+ Name string `json:"name,omitempty"`
+ // PipelineTaskName is the name of the PipelineTask this is referencing.
+ PipelineTaskName string `json:"pipelineTaskName,omitempty"`
+
+ // WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ // +optional
+ // +listType=atomic
+ WhenExpressions []WhenExpression `json:"whenExpressions,omitempty"`
+}
+
+// PipelineRunStatusFields holds the fields of PipelineRunStatus' status.
+// This is defined separately and inlined so that other types can readily
+// consume these fields via duck typing.
+type PipelineRunStatusFields struct {
+ // StartTime is the time the PipelineRun is actually started.
+ // +optional
+ StartTime *metav1.Time `json:"startTime,omitempty"`
+
+ // CompletionTime is the time the PipelineRun completed.
+ // +optional
+ CompletionTime *metav1.Time `json:"completionTime,omitempty"`
+
+ // Results are the list of results written out by the pipeline task's containers
+ // +optional
+ // +listType=atomic
+ Results []PipelineRunResult `json:"results,omitempty"`
+
+ // PipelineRunSpec contains the exact spec used to instantiate the run
+ PipelineSpec *PipelineSpec `json:"pipelineSpec,omitempty"`
+
+ // list of tasks that were skipped due to when expressions evaluating to false
+ // +optional
+ // +listType=atomic
+ SkippedTasks []SkippedTask `json:"skippedTasks,omitempty"`
+
+ // list of TaskRun and Run names, PipelineTask names, and API versions/kinds for children of this PipelineRun.
+ // +optional
+ // +listType=atomic
+ ChildReferences []ChildStatusReference `json:"childReferences,omitempty"`
+
+ // FinallyStartTime is when all non-finally tasks have been completed and only finally tasks are being executed.
+ // +optional
+ FinallyStartTime *metav1.Time `json:"finallyStartTime,omitempty"`
+}
+
+// SkippedTask is used to describe the Tasks that were skipped due to their When Expressions
+// evaluating to False. This is a struct because we are looking into including more details
+// about the When Expressions that caused this Task to be skipped.
+type SkippedTask struct {
+ // Name is the Pipeline Task name
+ Name string `json:"name"`
+ // Reason is the cause of the PipelineTask being skipped.
+ Reason SkippingReason `json:"reason"`
+ // WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ // +optional
+ // +listType=atomic
+ WhenExpressions []WhenExpression `json:"whenExpressions,omitempty"`
+}
+
+// SkippingReason explains why a PipelineTask was skipped.
+type SkippingReason string
+
+const (
+ // WhenExpressionsSkip means the task was skipped due to at least one of its when expressions evaluating to false
+ WhenExpressionsSkip SkippingReason = "When Expressions evaluated to false"
+ // ParentTasksSkip means the task was skipped because its parent was skipped
+ ParentTasksSkip SkippingReason = "Parent Tasks were skipped"
+ // StoppingSkip means the task was skipped because the pipeline run is stopping
+ StoppingSkip SkippingReason = "PipelineRun was stopping"
+ // GracefullyCancelledSkip means the task was skipped because the pipeline run has been gracefully cancelled
+ GracefullyCancelledSkip SkippingReason = "PipelineRun was gracefully cancelled"
+ // GracefullyStoppedSkip means the task was skipped because the pipeline run has been gracefully stopped
+ GracefullyStoppedSkip SkippingReason = "PipelineRun was gracefully stopped"
+ // MissingResultsSkip means the task was skipped because it's missing necessary results
+ MissingResultsSkip SkippingReason = "Results were missing"
+ // PipelineTimedOutSkip means the task was skipped because the PipelineRun has passed its overall timeout.
+ PipelineTimedOutSkip SkippingReason = "PipelineRun timeout has been reached"
+ // TasksTimedOutSkip means the task was skipped because the PipelineRun has passed its Timeouts.Tasks.
+ TasksTimedOutSkip SkippingReason = "PipelineRun Tasks timeout has been reached"
+ // FinallyTimedOutSkip means the task was skipped because the PipelineRun has passed its Timeouts.Finally.
+ FinallyTimedOutSkip SkippingReason = "PipelineRun Finally timeout has been reached"
+ // None means the task was not skipped
+ None SkippingReason = "None"
+)
+
+// PipelineRunResult used to describe the results of a pipeline
+type PipelineRunResult struct {
+ // Name is the result's name as declared by the Pipeline
+ Name string `json:"name"`
+
+ // Value is the result returned from the execution of this PipelineRun
+ Value ResultValue `json:"value"`
+}
+
+// PipelineRunTaskRunStatus contains the name of the PipelineTask for this TaskRun and the TaskRun's Status
+type PipelineRunTaskRunStatus struct {
+ // PipelineTaskName is the name of the PipelineTask.
+ PipelineTaskName string `json:"pipelineTaskName,omitempty"`
+ // Status is the TaskRunStatus for the corresponding TaskRun
+ // +optional
+ Status *TaskRunStatus `json:"status,omitempty"`
+ // WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ // +optional
+ // +listType=atomic
+ WhenExpressions []WhenExpression `json:"whenExpressions,omitempty"`
+}
+
+// PipelineRunRunStatus contains the name of the PipelineTask for this Run and the Run's Status
+type PipelineRunRunStatus struct {
+ // PipelineTaskName is the name of the PipelineTask.
+ PipelineTaskName string `json:"pipelineTaskName,omitempty"`
+ // Status is the RunStatus for the corresponding Run
+ // +optional
+ Status *runv1alpha1.RunStatus `json:"status,omitempty"`
+ // WhenExpressions is the list of checks guarding the execution of the PipelineTask
+ // +optional
+ // +listType=atomic
+ WhenExpressions []WhenExpression `json:"whenExpressions,omitempty"`
+}
+
+// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
+
+// PipelineRunList contains a list of PipelineRun
+type PipelineRunList struct {
+ metav1.TypeMeta `json:",inline"`
+ // +optional
+ metav1.ListMeta `json:"metadata,omitempty"`
+ Items []PipelineRun `json:"items,omitempty"`
+}
+
+// PipelineTaskRun reports the results of running a step in the Task. Each
+// task has the potential to succeed or fail (based on the exit code)
+// and produces logs.
+type PipelineTaskRun struct {
+ Name string `json:"name,omitempty"`
+}
+
+// PipelineTaskRunSpec can be used to configure specific
+// specs for a concrete Task
+type PipelineTaskRunSpec struct {
+ PipelineTaskName string `json:"pipelineTaskName,omitempty"`
+ ServiceAccountName string `json:"serviceAccountName,omitempty"`
+ PodTemplate *pod.PodTemplate `json:"podTemplate,omitempty"`
+ // +listType=atomic
+ StepOverrides []TaskRunStepOverride `json:"stepOverrides,omitempty"`
+ // +listType=atomic
+ SidecarOverrides []TaskRunSidecarOverride `json:"sidecarOverrides,omitempty"`
+
+ // +optional
+ Metadata *PipelineTaskMetadata `json:"metadata,omitempty"`
+
+ // Compute resources to use for this TaskRun
+ ComputeResources *corev1.ResourceRequirements `json:"computeResources,omitempty"`
+}
+
+// GetTaskRunSpec returns the task specific spec for a given
+// PipelineTask if configured, otherwise it returns the PipelineRun's default.
+func (pr *PipelineRun) GetTaskRunSpec(pipelineTaskName string) PipelineTaskRunSpec {
+ s := PipelineTaskRunSpec{
+ PipelineTaskName: pipelineTaskName,
+ ServiceAccountName: pr.Spec.ServiceAccountName,
+ PodTemplate: pr.Spec.PodTemplate,
+ }
+ for _, task := range pr.Spec.TaskRunSpecs {
+ if task.PipelineTaskName == pipelineTaskName {
+ if task.PodTemplate != nil {
+ s.PodTemplate = task.PodTemplate
+ }
+ if task.ServiceAccountName != "" {
+ s.ServiceAccountName = task.ServiceAccountName
+ }
+ s.StepOverrides = task.StepOverrides
+ s.SidecarOverrides = task.SidecarOverrides
+ s.Metadata = task.Metadata
+ s.ComputeResources = task.ComputeResources
+ }
+ }
+ return s
+}
diff --git a/pkg/apis/pipeline/v1/pipelinerun_types_test.go b/pkg/apis/pipeline/v1/pipelinerun_types_test.go
new file mode 100644
index 00000000000..ffa95fb4820
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelinerun_types_test.go
@@ -0,0 +1,396 @@
+/*
+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_test
+
+import (
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ "github.com/tektoncd/pipeline/test/diff"
+ corev1 "k8s.io/api/core/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "knative.dev/pkg/apis"
+)
+
+func TestPipelineRunStatusConditions(t *testing.T) {
+ p := &v1.PipelineRun{}
+ foo := &apis.Condition{
+ Type: "Foo",
+ Status: "True",
+ }
+ bar := &apis.Condition{
+ Type: "Bar",
+ Status: "True",
+ }
+
+ var ignoreVolatileTime = cmp.Comparer(func(_, _ apis.VolatileTime) bool {
+ return true
+ })
+
+ // Add a new condition.
+ p.Status.SetCondition(foo)
+
+ fooStatus := p.Status.GetCondition(foo.Type)
+ if d := cmp.Diff(fooStatus, foo, ignoreVolatileTime); d != "" {
+ t.Errorf("Unexpected pipeline run condition type; diff %v", diff.PrintWantGot(d))
+ }
+
+ // Add a second condition.
+ p.Status.SetCondition(bar)
+
+ barStatus := p.Status.GetCondition(bar.Type)
+
+ if d := cmp.Diff(barStatus, bar, ignoreVolatileTime); d != "" {
+ t.Fatalf("Unexpected pipeline run condition type; diff %s", diff.PrintWantGot(d))
+ }
+}
+
+func TestInitializePipelineRunConditions(t *testing.T) {
+ p := &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "test-name",
+ Namespace: "test-ns",
+ },
+ }
+ p.Status.InitializeConditions(testClock)
+
+ if p.Status.StartTime.IsZero() {
+ t.Fatalf("PipelineRun StartTime not initialized correctly")
+ }
+
+ condition := p.Status.GetCondition(apis.ConditionSucceeded)
+ if condition.Reason != v1.PipelineRunReasonStarted.String() {
+ t.Fatalf("PipelineRun initialize reason should be %s, got %s instead", v1.PipelineRunReasonStarted.String(), condition.Reason)
+ }
+
+ // Change the reason before we initialize again
+ p.Status.SetCondition(&apis.Condition{
+ Type: apis.ConditionSucceeded,
+ Status: corev1.ConditionUnknown,
+ Reason: "not just started",
+ Message: "hello",
+ })
+
+ p.Status.InitializeConditions(testClock)
+
+ newCondition := p.Status.GetCondition(apis.ConditionSucceeded)
+ if newCondition.Reason != "not just started" {
+ t.Fatalf("PipelineRun initialize reset the condition reason to %s", newCondition.Reason)
+ }
+}
+
+func TestPipelineRunIsDone(t *testing.T) {
+ pr := &v1.PipelineRun{}
+ foo := &apis.Condition{
+ Type: apis.ConditionSucceeded,
+ Status: corev1.ConditionFalse,
+ }
+ pr.Status.SetCondition(foo)
+ if !pr.IsDone() {
+ t.Fatal("Expected pipelinerun status to be done")
+ }
+}
+
+func TestPipelineRunIsCancelled(t *testing.T) {
+ pr := &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusCancelled,
+ },
+ }
+ if !pr.IsCancelled() {
+ t.Fatal("Expected pipelinerun status to be cancelled")
+ }
+}
+
+func TestPipelineRunIsGracefullyCancelled(t *testing.T) {
+ pr := &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusCancelledRunFinally,
+ },
+ }
+ if !pr.IsGracefullyCancelled() {
+ t.Fatal("Expected pipelinerun status to be gracefully cancelled")
+ }
+}
+
+func TestPipelineRunIsGracefullyStopped(t *testing.T) {
+ pr := &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusStoppedRunFinally,
+ },
+ }
+ if !pr.IsGracefullyStopped() {
+ t.Fatal("Expected pipelinerun status to be gracefully stopped")
+ }
+}
+
+func TestPipelineRunHasVolumeClaimTemplate(t *testing.T) {
+ pr := &v1.PipelineRun{
+ Spec: v1.PipelineRunSpec{
+ Workspaces: []v1.WorkspaceBinding{{
+ Name: "my-workspace",
+ VolumeClaimTemplate: &corev1.PersistentVolumeClaim{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pvc",
+ },
+ Spec: corev1.PersistentVolumeClaimSpec{},
+ },
+ }},
+ },
+ }
+ if !pr.HasVolumeClaimTemplate() {
+ t.Fatal("Expected pipelinerun to have a volumeClaimTemplate workspace")
+ }
+}
+
+func TestGetNamespacedName(t *testing.T) {
+ pr := &v1.PipelineRun{ObjectMeta: metav1.ObjectMeta{Namespace: "foo", Name: "prunname"}}
+ n := pr.GetNamespacedName()
+ expected := "foo/prunname"
+ if n.String() != expected {
+ t.Fatalf("Expected name to be %s but got %s", expected, n.String())
+ }
+}
+
+func TestPipelineRunHasStarted(t *testing.T) {
+ params := []struct {
+ name string
+ prStatus v1.PipelineRunStatus
+ expectedValue bool
+ }{{
+ name: "prWithNoStartTime",
+ prStatus: v1.PipelineRunStatus{},
+ expectedValue: false,
+ }, {
+ name: "prWithStartTime",
+ prStatus: v1.PipelineRunStatus{
+ PipelineRunStatusFields: v1.PipelineRunStatusFields{
+ StartTime: &metav1.Time{Time: now},
+ },
+ },
+ expectedValue: true,
+ }, {
+ name: "prWithZeroStartTime",
+ prStatus: v1.PipelineRunStatus{
+ PipelineRunStatusFields: v1.PipelineRunStatusFields{
+ StartTime: &metav1.Time{},
+ },
+ },
+ expectedValue: false,
+ }}
+ for _, tc := range params {
+ t.Run(tc.name, func(t *testing.T) {
+ pr := &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "prunname",
+ Namespace: "testns",
+ },
+ Status: tc.prStatus,
+ }
+ if pr.HasStarted() != tc.expectedValue {
+ t.Fatalf("Expected pipelinerun HasStarted() to return %t but got %t", tc.expectedValue, pr.HasStarted())
+ }
+ })
+ }
+}
+
+func TestPipelineRunTimeouts(t *testing.T) {
+ tcs := []struct {
+ name string
+ timeouts *v1.TimeoutFields
+ expectedTasksTimeout *metav1.Duration
+ expectedFinallyTimeout *metav1.Duration
+ }{{
+ name: "no timeouts",
+ }, {
+ name: "pipeline timeout set",
+ timeouts: &v1.TimeoutFields{Pipeline: &metav1.Duration{Duration: time.Minute}},
+ }, {
+ name: "pipeline and tasks timeout set",
+ timeouts: &v1.TimeoutFields{Pipeline: &metav1.Duration{Duration: time.Hour}, Tasks: &metav1.Duration{Duration: 10 * time.Minute}},
+ expectedTasksTimeout: &metav1.Duration{Duration: 10 * time.Minute},
+ expectedFinallyTimeout: &metav1.Duration{Duration: 50 * time.Minute},
+ }, {
+
+ name: "pipeline and finally timeout set",
+ timeouts: &v1.TimeoutFields{Pipeline: &metav1.Duration{Duration: time.Hour}, Finally: &metav1.Duration{Duration: 10 * time.Minute}},
+ expectedTasksTimeout: &metav1.Duration{Duration: 50 * time.Minute},
+ expectedFinallyTimeout: &metav1.Duration{Duration: 10 * time.Minute},
+ }, {
+ name: "tasks timeout set",
+ timeouts: &v1.TimeoutFields{Tasks: &metav1.Duration{Duration: 10 * time.Minute}},
+ expectedTasksTimeout: &metav1.Duration{Duration: 10 * time.Minute},
+ }, {
+ name: "finally timeout set",
+ timeouts: &v1.TimeoutFields{Finally: &metav1.Duration{Duration: 10 * time.Minute}},
+ expectedFinallyTimeout: &metav1.Duration{Duration: 10 * time.Minute},
+ }, {
+ name: "no tasks timeout",
+ timeouts: &v1.TimeoutFields{Pipeline: &metav1.Duration{Duration: 0}, Tasks: &metav1.Duration{Duration: 0}},
+ expectedTasksTimeout: &metav1.Duration{Duration: 0},
+ }, {
+ name: "no finally timeout",
+ timeouts: &v1.TimeoutFields{Pipeline: &metav1.Duration{Duration: 0}, Finally: &metav1.Duration{Duration: 0}},
+ expectedFinallyTimeout: &metav1.Duration{Duration: 0},
+ }}
+
+ for _, tc := range tcs {
+ t.Run(tc.name, func(t *testing.T) {
+ pr := &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{Name: "foo"},
+ Spec: v1.PipelineRunSpec{
+ Timeouts: tc.timeouts,
+ },
+ }
+
+ tasksTimeout := pr.TasksTimeout()
+ if ok := cmp.Equal(tc.expectedTasksTimeout, pr.TasksTimeout()); !ok {
+ t.Errorf("Unexpected tasks timeout %v, expected %v", tasksTimeout, tc.expectedTasksTimeout)
+ }
+ finallyTimeout := pr.FinallyTimeout()
+ if ok := cmp.Equal(tc.expectedFinallyTimeout, pr.FinallyTimeout()); !ok {
+ t.Errorf("Unexpected finally timeout %v, expected %v", finallyTimeout, tc.expectedFinallyTimeout)
+ }
+ })
+ }
+}
+
+func TestPipelineRunGetPodSpecSABackcompatibility(t *testing.T) {
+ for _, tt := range []struct {
+ name string
+ pr *v1.PipelineRun
+ expectedSAs map[string]string
+ }{
+ {
+ name: "test backward compatibility",
+ pr: &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{Name: "pr"},
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "prs"},
+ ServiceAccountName: "defaultSA",
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{{
+ PipelineTaskName: "taskName",
+ ServiceAccountName: "newTaskSA",
+ }},
+ },
+ },
+ expectedSAs: map[string]string{
+ "unknown": "defaultSA",
+ "taskName": "newTaskSA",
+ },
+ }, {
+ name: "mixed default SA backward compatibility",
+ pr: &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{Name: "pr"},
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "prs"},
+ ServiceAccountName: "defaultSA",
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{{
+ PipelineTaskName: "taskNameOne",
+ ServiceAccountName: "TaskSAOne",
+ }, {
+ PipelineTaskName: "taskNameTwo",
+ ServiceAccountName: "newTaskTwo",
+ }},
+ },
+ },
+ expectedSAs: map[string]string{
+ "unknown": "defaultSA",
+ "taskNameOne": "TaskSAOne",
+ "taskNameTwo": "newTaskTwo",
+ },
+ }, {
+ name: "mixed SA and TaskRunSpec",
+ pr: &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{Name: "pr"},
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "prs"},
+ ServiceAccountName: "defaultSA",
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{{
+ PipelineTaskName: "taskNameOne",
+ }, {
+ PipelineTaskName: "taskNameTwo",
+ ServiceAccountName: "newTaskTwo",
+ }},
+ },
+ },
+ expectedSAs: map[string]string{
+ "unknown": "defaultSA",
+ "taskNameOne": "defaultSA",
+ "taskNameTwo": "newTaskTwo",
+ },
+ },
+ } {
+ for taskName, expected := range tt.expectedSAs {
+ t.Run(tt.name, func(t *testing.T) {
+ s := tt.pr.GetTaskRunSpec(taskName)
+ if expected != s.ServiceAccountName {
+ t.Errorf("wrong service account: got: %v, want: %v", s.ServiceAccountName, expected)
+ }
+ })
+ }
+ }
+}
+
+func TestPipelineRunGetPodSpec(t *testing.T) {
+ for _, tt := range []struct {
+ name string
+ pr *v1.PipelineRun
+ expectedPodTemplates map[string][]string
+ }{
+ {
+ name: "mix default and none default",
+ pr: &v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{Name: "pr"},
+ Spec: v1.PipelineRunSpec{
+ PodTemplate: &pod.Template{SchedulerName: "scheduleTest"},
+ PipelineRef: &v1.PipelineRef{Name: "prs"},
+ ServiceAccountName: "defaultSA",
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{{
+ PipelineTaskName: "taskNameOne",
+ ServiceAccountName: "TaskSAOne",
+ PodTemplate: &pod.Template{SchedulerName: "scheduleTestOne"},
+ }, {
+ PipelineTaskName: "taskNameTwo",
+ ServiceAccountName: "newTaskTwo",
+ PodTemplate: &pod.Template{SchedulerName: "scheduleTestTwo"},
+ }},
+ },
+ },
+ expectedPodTemplates: map[string][]string{
+ "unknown": {"scheduleTest", "defaultSA"},
+ "taskNameOne": {"scheduleTestOne", "TaskSAOne"},
+ "taskNameTwo": {"scheduleTestTwo", "newTaskTwo"},
+ },
+ },
+ } {
+ for taskName, values := range tt.expectedPodTemplates {
+ t.Run(tt.name, func(t *testing.T) {
+ s := tt.pr.GetTaskRunSpec(taskName)
+ if values[0] != s.PodTemplate.SchedulerName {
+ t.Errorf("wrong task podtemplate scheduler name: got: %v, want: %v", s.PodTemplate.SchedulerName, values[0])
+ }
+ if values[1] != s.ServiceAccountName {
+ t.Errorf("wrong service account: got: %v, want: %v", s.ServiceAccountName, values[1])
+ }
+ })
+ }
+ }
+}
diff --git a/pkg/apis/pipeline/v1/pipelinerun_validation.go b/pkg/apis/pipeline/v1/pipelinerun_validation.go
new file mode 100644
index 00000000000..d145a9f0a17
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelinerun_validation.go
@@ -0,0 +1,291 @@
+/*
+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
+
+import (
+ "context"
+ "fmt"
+ "time"
+
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ "github.com/tektoncd/pipeline/pkg/apis/validate"
+ "github.com/tektoncd/pipeline/pkg/apis/version"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "knative.dev/pkg/apis"
+)
+
+var _ apis.Validatable = (*PipelineRun)(nil)
+
+// Validate pipelinerun
+func (pr *PipelineRun) Validate(ctx context.Context) *apis.FieldError {
+ if apis.IsInDelete(ctx) {
+ return nil
+ }
+
+ errs := validate.ObjectMetadata(pr.GetObjectMeta()).ViaField("metadata")
+
+ if pr.IsPending() && pr.HasStarted() {
+ errs = errs.Also(apis.ErrInvalidValue("PipelineRun cannot be Pending after it is started", "spec.status"))
+ }
+
+ return errs.Also(pr.Spec.Validate(apis.WithinSpec(ctx)).ViaField("spec"))
+}
+
+// Validate pipelinerun spec
+func (ps *PipelineRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) {
+ // Must have exactly one of pipelineRef and pipelineSpec.
+ if ps.PipelineRef == nil && ps.PipelineSpec == nil {
+ errs = errs.Also(apis.ErrMissingOneOf("pipelineRef", "pipelineSpec"))
+ }
+ if ps.PipelineRef != nil && ps.PipelineSpec != nil {
+ errs = errs.Also(apis.ErrMultipleOneOf("pipelineRef", "pipelineSpec"))
+ }
+
+ // Validate PipelineRef if it's present
+ if ps.PipelineRef != nil {
+ errs = errs.Also(ps.PipelineRef.Validate(ctx).ViaField("pipelineRef"))
+ }
+
+ // Validate PipelineSpec if it's present
+ if ps.PipelineSpec != nil {
+ ctx = config.SkipValidationDueToPropagatedParametersAndWorkspaces(ctx, true)
+ errs = errs.Also(ps.PipelineSpec.Validate(ctx).ViaField("pipelineSpec"))
+ }
+
+ // Validate PipelineRun parameters
+ errs = errs.Also(ps.validatePipelineRunParameters(ctx))
+
+ // Validate propagated parameters
+ errs = errs.Also(ps.validateInlineParameters(ctx))
+
+ if ps.Timeouts != nil {
+ // tasks timeout should be a valid duration of at least 0.
+ errs = errs.Also(validateTimeoutDuration("tasks", ps.Timeouts.Tasks))
+
+ // finally timeout should be a valid duration of at least 0.
+ errs = errs.Also(validateTimeoutDuration("finally", ps.Timeouts.Finally))
+
+ // pipeline timeout should be a valid duration of at least 0.
+ errs = errs.Also(validateTimeoutDuration("pipeline", ps.Timeouts.Pipeline))
+
+ if ps.Timeouts.Pipeline != nil {
+ errs = errs.Also(ps.validatePipelineTimeout(ps.Timeouts.Pipeline.Duration, "should be <= pipeline duration"))
+ } else {
+ defaultTimeout := time.Duration(config.FromContextOrDefaults(ctx).Defaults.DefaultTimeoutMinutes)
+ errs = errs.Also(ps.validatePipelineTimeout(defaultTimeout, "should be <= default timeout duration"))
+ }
+ }
+
+ errs = errs.Also(validateSpecStatus(ps.Status))
+
+ if ps.Workspaces != nil {
+ wsNames := make(map[string]int)
+ for idx, ws := range ps.Workspaces {
+ errs = errs.Also(ws.Validate(ctx).ViaFieldIndex("workspaces", idx))
+ if prevIdx, alreadyExists := wsNames[ws.Name]; alreadyExists {
+ errs = errs.Also(apis.ErrGeneric(fmt.Sprintf("workspace %q provided by pipelinerun more than once, at index %d and %d", ws.Name, prevIdx, idx), "name").ViaFieldIndex("workspaces", idx))
+ }
+ wsNames[ws.Name] = idx
+ }
+ }
+ for idx, trs := range ps.TaskRunSpecs {
+ errs = errs.Also(validateTaskRunSpec(ctx, trs).ViaIndex(idx).ViaField("taskRunSpecs"))
+ }
+
+ return errs
+}
+
+func (ps *PipelineRunSpec) validatePipelineRunParameters(ctx context.Context) (errs *apis.FieldError) {
+ if len(ps.Params) == 0 {
+ return errs
+ }
+
+ // Validate parameter types and uniqueness
+ errs = errs.Also(ValidateParameters(ctx, ps.Params).ViaField("params"))
+
+ // Validate that task results aren't used in param values
+ for _, param := range ps.Params {
+ expressions, ok := GetVarSubstitutionExpressionsForParam(param)
+ if ok {
+ if LooksLikeContainsResultRefs(expressions) {
+ expressions = filter(expressions, looksLikeResultRef)
+ resultRefs := NewResultRefs(expressions)
+ if len(resultRefs) > 0 {
+ errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("cannot use result expressions in %v as PipelineRun parameter values", expressions),
+ "value").ViaFieldKey("params", param.Name))
+ }
+ }
+ }
+ }
+
+ return errs
+}
+
+// validateInlineParameters validates parameters that are defined inline.
+// This is crucial for propagated parameters since the parameters could
+// be defined under pipelineRun and then called directly in the task steps.
+// In this case, parameters cannot be validated by the underlying pipelineSpec
+// or taskSpec since they may not have the parameters declared because of propagation.
+func (ps *PipelineRunSpec) validateInlineParameters(ctx context.Context) (errs *apis.FieldError) {
+ if ps.PipelineSpec == nil {
+ return errs
+ }
+ var paramSpec []ParamSpec
+ for _, p := range ps.Params {
+ pSpec := ParamSpec{
+ Name: p.Name,
+ Default: &p.Value,
+ }
+ paramSpec = append(paramSpec, pSpec)
+ }
+ paramSpec = appendParamSpec(paramSpec, ps.PipelineSpec.Params)
+ for _, pt := range ps.PipelineSpec.Tasks {
+ paramSpec = appendParam(paramSpec, pt.Params)
+ if pt.TaskSpec != nil && pt.TaskSpec.Params != nil {
+ paramSpec = appendParamSpec(paramSpec, pt.TaskSpec.Params)
+ }
+ }
+ if ps.PipelineSpec != nil && ps.PipelineSpec.Tasks != nil {
+ for _, pt := range ps.PipelineSpec.Tasks {
+ if pt.TaskSpec != nil && pt.TaskSpec.Steps != nil {
+ errs = errs.Also(ValidateParameterVariables(
+ config.SkipValidationDueToPropagatedParametersAndWorkspaces(ctx, false), pt.TaskSpec.Steps, paramSpec))
+ }
+ }
+ }
+ return errs
+}
+
+func appendParamSpec(paramSpec []ParamSpec, params []ParamSpec) []ParamSpec {
+ for _, p := range params {
+ skip := false
+ for _, ps := range paramSpec {
+ if ps.Name == p.Name {
+ skip = true
+ break
+ }
+ }
+ if !skip {
+ paramSpec = append(paramSpec, p)
+ }
+ }
+ return paramSpec
+}
+
+func appendParam(paramSpec []ParamSpec, params []Param) []ParamSpec {
+ for _, p := range params {
+ skip := false
+ for _, ps := range paramSpec {
+ if ps.Name == p.Name {
+ skip = true
+ break
+ }
+ }
+ if !skip {
+ pSpec := ParamSpec{
+ Name: p.Name,
+ Default: &p.Value,
+ }
+ paramSpec = append(paramSpec, pSpec)
+ }
+ }
+ return paramSpec
+}
+
+func validateSpecStatus(status PipelineRunSpecStatus) *apis.FieldError {
+ switch status {
+ case "":
+ return nil
+ case PipelineRunSpecStatusPending:
+ return nil
+ case PipelineRunSpecStatusCancelled,
+ PipelineRunSpecStatusCancelledRunFinally,
+ PipelineRunSpecStatusStoppedRunFinally:
+ return nil
+ }
+
+ return apis.ErrInvalidValue(fmt.Sprintf("%s should be %s, %s, %s or %s", status,
+ PipelineRunSpecStatusCancelled,
+ PipelineRunSpecStatusCancelledRunFinally,
+ PipelineRunSpecStatusStoppedRunFinally,
+ PipelineRunSpecStatusPending), "status")
+
+}
+
+func validateTimeoutDuration(field string, d *metav1.Duration) (errs *apis.FieldError) {
+ if d != nil && d.Duration < 0 {
+ fieldPath := fmt.Sprintf("timeouts.%s", field)
+ return errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s should be >= 0", d.Duration.String()), fieldPath))
+ }
+ return nil
+}
+
+func (ps *PipelineRunSpec) validatePipelineTimeout(timeout time.Duration, errorMsg string) (errs *apis.FieldError) {
+ if ps.Timeouts.Tasks != nil {
+ tasksTimeoutErr := false
+ tasksTimeoutStr := ps.Timeouts.Tasks.Duration.String()
+ if ps.Timeouts.Tasks.Duration > timeout {
+ tasksTimeoutErr = true
+ }
+ if ps.Timeouts.Tasks.Duration == config.NoTimeoutDuration && timeout != config.NoTimeoutDuration {
+ tasksTimeoutErr = true
+ tasksTimeoutStr += " (no timeout)"
+ }
+ if tasksTimeoutErr {
+ errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s %s", tasksTimeoutStr, errorMsg), "timeouts.tasks"))
+ }
+ }
+
+ if ps.Timeouts.Finally != nil {
+ finallyTimeoutErr := false
+ finallyTimeoutStr := ps.Timeouts.Finally.Duration.String()
+ if ps.Timeouts.Finally.Duration > timeout {
+ finallyTimeoutErr = true
+ }
+ if ps.Timeouts.Finally.Duration == config.NoTimeoutDuration && timeout != config.NoTimeoutDuration {
+ finallyTimeoutErr = true
+ finallyTimeoutStr += " (no timeout)"
+ }
+ if finallyTimeoutErr {
+ errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s %s", finallyTimeoutStr, errorMsg), "timeouts.finally"))
+ }
+ }
+
+ if ps.Timeouts.Tasks != nil && ps.Timeouts.Finally != nil {
+ if ps.Timeouts.Tasks.Duration+ps.Timeouts.Finally.Duration > timeout {
+ errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s + %s %s", ps.Timeouts.Tasks.Duration.String(), ps.Timeouts.Finally.Duration.String(), errorMsg), "timeouts.tasks"))
+ errs = errs.Also(apis.ErrInvalidValue(fmt.Sprintf("%s + %s %s", ps.Timeouts.Tasks.Duration.String(), ps.Timeouts.Finally.Duration.String(), errorMsg), "timeouts.finally"))
+ }
+ }
+ return errs
+}
+
+func validateTaskRunSpec(ctx context.Context, trs PipelineTaskRunSpec) (errs *apis.FieldError) {
+ if trs.StepOverrides != nil {
+ errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "stepOverrides", config.AlphaAPIFields).ViaField("stepOverrides"))
+ errs = errs.Also(validateStepOverrides(trs.StepOverrides).ViaField("stepOverrides"))
+ }
+ if trs.SidecarOverrides != nil {
+ errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.AlphaAPIFields).ViaField("sidecarOverrides"))
+ errs = errs.Also(validateSidecarOverrides(trs.SidecarOverrides).ViaField("sidecarOverrides"))
+ }
+ if trs.ComputeResources != nil {
+ errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "computeResources", config.AlphaAPIFields).ViaField("computeResources"))
+ errs = errs.Also(validateTaskRunComputeResources(trs.ComputeResources, trs.StepOverrides))
+ }
+ return errs
+}
diff --git a/pkg/apis/pipeline/v1/pipelinerun_validation_test.go b/pkg/apis/pipeline/v1/pipelinerun_validation_test.go
new file mode 100644
index 00000000000..3b363e527e1
--- /dev/null
+++ b/pkg/apis/pipeline/v1/pipelinerun_validation_test.go
@@ -0,0 +1,809 @@
+/*
+Copyright 2020 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_test
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/google/go-cmp/cmp"
+ "github.com/tektoncd/pipeline/pkg/apis/config"
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ "github.com/tektoncd/pipeline/test/diff"
+ corev1 "k8s.io/api/core/v1"
+ corev1resources "k8s.io/apimachinery/pkg/api/resource"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "knative.dev/pkg/apis"
+)
+
+func TestPipelineRun_Invalid(t *testing.T) {
+ tests := []struct {
+ name string
+ pr v1.PipelineRun
+ want *apis.FieldError
+ wc func(context.Context) context.Context
+ }{{
+ name: "no pipeline reference",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ ServiceAccountName: "foo",
+ },
+ },
+ want: apis.ErrMissingOneOf("spec.pipelineRef", "spec.pipelineSpec"),
+ }, {
+ name: "invalid pipelinerun metadata",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinerun,name",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ want: &apis.FieldError{
+ Message: `invalid resource name "pipelinerun,name": must be a valid DNS label`,
+ Paths: []string{"metadata.name"},
+ },
+ }, {
+ name: "wrong pipelinerun cancel",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Status: "PipelineRunCancell",
+ },
+ },
+ want: apis.ErrInvalidValue("PipelineRunCancell should be Cancelled, CancelledRunFinally, StoppedRunFinally or PipelineRunPending", "spec.status"),
+ }, {
+ name: "pipelinerun pending while running",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinerunname",
+ },
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusPending,
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ Status: v1.PipelineRunStatus{
+ PipelineRunStatusFields: v1.PipelineRunStatusFields{
+ StartTime: &metav1.Time{time.Now()},
+ },
+ },
+ },
+ want: &apis.FieldError{
+ Message: "invalid value: PipelineRun cannot be Pending after it is started",
+ Paths: []string{"spec.status"},
+ },
+ }}
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ ctx := context.Background()
+ if tc.wc != nil {
+ ctx = tc.wc(ctx)
+ }
+ err := tc.pr.Validate(ctx)
+ if d := cmp.Diff(tc.want.Error(), err.Error()); d != "" {
+ t.Error(diff.PrintWantGot(d))
+ }
+ })
+ }
+}
+
+func TestPipelineRun_Validate(t *testing.T) {
+ tests := []struct {
+ name string
+ pr v1.PipelineRun
+ wc func(context.Context) context.Context
+ }{{
+ name: "normal case",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ }, {
+ name: "no timeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ }, {
+ name: "array param with pipelinespec and taskspec",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineSpec: &v1.PipelineSpec{
+ Params: []v1.ParamSpec{{
+ Name: "pipeline-words",
+ Type: v1.ParamTypeArray,
+ }},
+ Tasks: []v1.PipelineTask{{
+ Name: "echoit",
+ Params: []v1.Param{{
+ Name: "task-words",
+ Value: v1.ParamValue{
+ ArrayVal: []string{"$(params.pipeline-words)"},
+ },
+ }},
+ TaskSpec: &v1.EmbeddedTask{TaskSpec: v1.TaskSpec{
+ Params: []v1.ParamSpec{{
+ Name: "task-words",
+ Type: v1.ParamTypeArray,
+ }},
+ Steps: []v1.Step{{
+ Name: "echo",
+ Image: "ubuntu",
+ Command: []string{"echo"},
+ Args: []string{"$(params.task-words[*])"},
+ }},
+ }},
+ }},
+ },
+ },
+ },
+ }, {
+ name: "pipelinerun pending",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinerunname",
+ },
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusPending,
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ }, {
+ name: "do not validate spec on delete",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ wc: apis.WithinDelete,
+ }, {
+ name: "pipelinerun cancelled",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinerunname",
+ },
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusCancelled,
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ }, {
+ name: "pipelinerun gracefully cancelled",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinerunname",
+ },
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusCancelledRunFinally,
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ }, {
+ name: "pipelinerun gracefully stopped",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinerunname",
+ },
+ Spec: v1.PipelineRunSpec{
+ Status: v1.PipelineRunSpecStatusStoppedRunFinally,
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ },
+ },
+ }, {
+ name: "alpha feature: sidecar and step overrides",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pr",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "pr"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ StepOverrides: []v1.TaskRunStepOverride{{
+ Name: "task-1",
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ SidecarOverrides: []v1.TaskRunSidecarOverride{{
+ Name: "task-1",
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ },
+ },
+ },
+ },
+ wc: config.EnableAlphaAPIFields,
+ }}
+
+ for _, ts := range tests {
+ t.Run(ts.name, func(t *testing.T) {
+ ctx := context.Background()
+ if ts.wc != nil {
+ ctx = ts.wc(ctx)
+ }
+ if err := ts.pr.Validate(ctx); err != nil {
+ t.Error(err)
+ }
+ })
+ }
+}
+
+func TestPipelineRunSpec_Invalidate(t *testing.T) {
+ tests := []struct {
+ name string
+ spec v1.PipelineRunSpec
+ wantErr *apis.FieldError
+ withContext func(context.Context) context.Context
+ }{{
+ name: "pipelineRef and pipelineSpec together",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "pipelinerefname",
+ },
+ PipelineSpec: &v1.PipelineSpec{
+ Tasks: []v1.PipelineTask{{
+ Name: "mytask",
+ TaskRef: &v1.TaskRef{
+ Name: "mytask",
+ },
+ }}},
+ },
+ wantErr: apis.ErrMultipleOneOf("pipelineRef", "pipelineSpec"),
+ }, {
+ name: "workspaces may only appear once",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "pipelinerefname",
+ },
+ Workspaces: []v1.WorkspaceBinding{{
+ Name: "ws",
+ EmptyDir: &corev1.EmptyDirVolumeSource{},
+ }, {
+ Name: "ws",
+ EmptyDir: &corev1.EmptyDirVolumeSource{},
+ }},
+ },
+ wantErr: &apis.FieldError{
+ Message: `workspace "ws" provided by pipelinerun more than once, at index 0 and 1`,
+ Paths: []string{"workspaces[1].name"},
+ },
+ }, {
+ name: "workspaces must contain a valid volume config",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "pipelinerefname",
+ },
+ Workspaces: []v1.WorkspaceBinding{{
+ Name: "ws",
+ }},
+ },
+ wantErr: &apis.FieldError{
+ Message: "expected exactly one, got neither",
+ Paths: []string{
+ "workspaces[0].configmap",
+ "workspaces[0].emptydir",
+ "workspaces[0].persistentvolumeclaim",
+ "workspaces[0].secret",
+ "workspaces[0].volumeclaimtemplate",
+ },
+ },
+ }, {
+ name: "duplicate stepOverride names",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ StepOverrides: []v1.TaskRunStepOverride{
+ {Name: "baz"}, {Name: "baz"},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrMultipleOneOf("taskRunSpecs[0].stepOverrides[1].name"),
+ withContext: config.EnableAlphaAPIFields,
+ }, {
+ name: "stepOverride disallowed without alpha feature gate",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ StepOverrides: []v1.TaskRunStepOverride{{
+ Name: "task-1",
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"),
+ }, {
+ name: "sidecarOverride disallowed without alpha feature gate",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ SidecarOverrides: []v1.TaskRunSidecarOverride{{
+ Name: "task-1",
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"),
+ }, {
+ name: "missing stepOverride name",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ StepOverrides: []v1.TaskRunStepOverride{{
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrMissingField("taskRunSpecs[0].stepOverrides[0].name"),
+ withContext: config.EnableAlphaAPIFields,
+ }, {
+ name: "duplicate sidecarOverride names",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ SidecarOverrides: []v1.TaskRunSidecarOverride{
+ {Name: "baz"}, {Name: "baz"},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrMultipleOneOf("taskRunSpecs[0].sidecarOverrides[1].name"),
+ withContext: config.EnableAlphaAPIFields,
+ }, {
+ name: "missing sidecarOverride name",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ SidecarOverrides: []v1.TaskRunSidecarOverride{{
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrMissingField("taskRunSpecs[0].sidecarOverrides[0].name"),
+ withContext: config.EnableAlphaAPIFields,
+ }, {
+ name: "invalid both step-level (stepOverrides.resources) and task-level (taskRunSpecs.resources) resource requirements configured",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "pipeline"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "pipelineTask",
+ StepOverrides: []v1.TaskRunStepOverride{{
+ Name: "stepOverride",
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")},
+ }},
+ },
+ ComputeResources: &corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("2Gi")},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrMultipleOneOf(
+ "taskRunSpecs[0].stepOverrides.resources",
+ "taskRunSpecs[0].computeResources",
+ ),
+ withContext: config.EnableAlphaAPIFields,
+ }, {
+ name: "computeResources disallowed without alpha feature gate",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "foo"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{
+ {
+ PipelineTaskName: "bar",
+ ComputeResources: &corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("2Gi")},
+ },
+ },
+ },
+ },
+ wantErr: apis.ErrGeneric("computeResources requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"),
+ }}
+
+ for _, ps := range tests {
+ t.Run(ps.name, func(t *testing.T) {
+ ctx := context.Background()
+ if ps.withContext != nil {
+ ctx = ps.withContext(ctx)
+ }
+ err := ps.spec.Validate(ctx)
+ if d := cmp.Diff(ps.wantErr.Error(), err.Error()); d != "" {
+ t.Error(diff.PrintWantGot(d))
+ }
+ })
+ }
+}
+
+func TestPipelineRunSpec_Validate(t *testing.T) {
+ tests := []struct {
+ name string
+ spec v1.PipelineRunSpec
+ withContext func(context.Context) context.Context
+ }{{
+ name: "PipelineRun without pipelineRef",
+ spec: v1.PipelineRunSpec{
+ PipelineSpec: &v1.PipelineSpec{
+ Tasks: []v1.PipelineTask{{
+ Name: "mytask",
+ TaskRef: &v1.TaskRef{
+ Name: "mytask",
+ },
+ }},
+ },
+ },
+ }, {
+ name: "valid task-level (taskRunSpecs.resources) resource requirements configured",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "pipeline"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{{
+ PipelineTaskName: "pipelineTask",
+ StepOverrides: []v1.TaskRunStepOverride{{
+ Name: "stepOverride",
+ }},
+ ComputeResources: &corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("2Gi")},
+ },
+ }},
+ },
+ withContext: config.EnableAlphaAPIFields,
+ }, {
+ name: "valid sidecar and task-level (taskRunSpecs.resources) resource requirements configured",
+ spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{Name: "pipeline"},
+ TaskRunSpecs: []v1.PipelineTaskRunSpec{{
+ PipelineTaskName: "pipelineTask",
+ StepOverrides: []v1.TaskRunStepOverride{{
+ Name: "stepOverride",
+ }},
+ ComputeResources: &corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("2Gi")},
+ },
+ SidecarOverrides: []v1.TaskRunSidecarOverride{{
+ Name: "sidecar",
+ Resources: corev1.ResourceRequirements{
+ Requests: corev1.ResourceList{
+ corev1.ResourceMemory: corev1resources.MustParse("4Gi"),
+ },
+ },
+ }},
+ }},
+ },
+ withContext: config.EnableAlphaAPIFields,
+ }}
+
+ for _, ps := range tests {
+ t.Run(ps.name, func(t *testing.T) {
+ ctx := context.Background()
+ if ps.withContext != nil {
+ ctx = ps.withContext(ctx)
+ }
+ if err := ps.spec.Validate(ctx); err != nil {
+ t.Error(err)
+ }
+ })
+ }
+}
+
+func TestPipelineRun_InvalidTimeouts(t *testing.T) {
+ tests := []struct {
+ name string
+ pr v1.PipelineRun
+ want *apis.FieldError
+ }{{
+ name: "negative pipeline timeouts",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: -48 * time.Hour},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue("-48h0m0s should be >= 0", "spec.timeouts.pipeline"),
+ }, {
+ name: "negative pipeline tasks Timeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Tasks: &metav1.Duration{Duration: -48 * time.Hour},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue("-48h0m0s should be >= 0", "spec.timeouts.tasks"),
+ }, {
+ name: "negative pipeline finally Timeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Finally: &metav1.Duration{Duration: -48 * time.Hour},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue("-48h0m0s should be >= 0", "spec.timeouts.finally"),
+ }, {
+ name: "pipeline tasks Timeout > pipeline Timeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 25 * time.Minute},
+ Tasks: &metav1.Duration{Duration: 1 * time.Hour},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue("1h0m0s should be <= pipeline duration", "spec.timeouts.tasks"),
+ }, {
+ name: "pipeline finally Timeout > pipeline Timeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 25 * time.Minute},
+ Finally: &metav1.Duration{Duration: 1 * time.Hour},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue("1h0m0s should be <= pipeline duration", "spec.timeouts.finally"),
+ }, {
+ name: "pipeline tasks Timeout + pipeline finally Timeout > pipeline Timeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 50 * time.Minute},
+ Tasks: &metav1.Duration{Duration: 30 * time.Minute},
+ Finally: &metav1.Duration{Duration: 30 * time.Minute},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue("30m0s + 30m0s should be <= pipeline duration", "spec.timeouts.finally, spec.timeouts.tasks"),
+ }, {
+ name: "Tasks timeout = 0 but Pipeline timeout not set",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Tasks: &metav1.Duration{Duration: 0 * time.Minute},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue(`0s (no timeout) should be <= default timeout duration`, "spec.timeouts.tasks"),
+ }, {
+ name: "Tasks timeout = 0 but Pipeline timeout is not 0",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 10 * time.Minute},
+ Tasks: &metav1.Duration{Duration: 0 * time.Minute},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue(`0s (no timeout) should be <= pipeline duration`, "spec.timeouts.tasks"),
+ }, {
+ name: "Finally timeout = 0 but Pipeline timeout not set",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Finally: &metav1.Duration{Duration: 0 * time.Minute},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue(`0s (no timeout) should be <= default timeout duration`, "spec.timeouts.finally"),
+ }, {
+ name: "Finally timeout = 0 but Pipeline timeout is not 0",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 10 * time.Minute},
+ Finally: &metav1.Duration{Duration: 0 * time.Minute},
+ },
+ },
+ },
+ want: apis.ErrInvalidValue(`0s (no timeout) should be <= pipeline duration`, "spec.timeouts.finally"),
+ }}
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ ctx := context.Background()
+ err := tc.pr.Validate(ctx)
+ if d := cmp.Diff(err.Error(), tc.want.Error()); d != "" {
+ t.Error(diff.PrintWantGot(d))
+ }
+ })
+ }
+}
+
+func TestPipelineRunWithTimeout_Validate(t *testing.T) {
+ tests := []struct {
+ name string
+ pr v1.PipelineRun
+ wc func(context.Context) context.Context
+ }{{
+ name: "no tasksTimeout",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 0},
+ Tasks: &metav1.Duration{Duration: 0},
+ Finally: &metav1.Duration{Duration: 0},
+ },
+ },
+ },
+ }, {
+ name: "Timeouts set for all three Task, Finally and Pipeline",
+ pr: v1.PipelineRun{
+ ObjectMeta: metav1.ObjectMeta{
+ Name: "pipelinelinename",
+ },
+ Spec: v1.PipelineRunSpec{
+ PipelineRef: &v1.PipelineRef{
+ Name: "prname",
+ },
+ Timeouts: &v1.TimeoutFields{
+ Pipeline: &metav1.Duration{Duration: 1 * time.Hour},
+ Tasks: &metav1.Duration{Duration: 30 * time.Minute},
+ Finally: &metav1.Duration{Duration: 30 * time.Minute},
+ },
+ },
+ },
+ }}
+
+ for _, ts := range tests {
+ t.Run(ts.name, func(t *testing.T) {
+ ctx := context.Background()
+ if ts.wc != nil {
+ ctx = ts.wc(ctx)
+ }
+ if err := ts.pr.Validate(ctx); err != nil {
+ t.Error(err)
+ }
+ })
+ }
+}
diff --git a/pkg/apis/pipeline/v1/swagger.json b/pkg/apis/pipeline/v1/swagger.json
index 862912773ec..d07d8227526 100644
--- a/pkg/apis/pipeline/v1/swagger.json
+++ b/pkg/apis/pipeline/v1/swagger.json
@@ -140,6 +140,35 @@
}
}
},
+ "v1.ChildStatusReference": {
+ "description": "ChildStatusReference is used to point to the statuses of individual TaskRuns and Runs within this PipelineRun.",
+ "type": "object",
+ "properties": {
+ "apiVersion": {
+ "type": "string"
+ },
+ "kind": {
+ "type": "string"
+ },
+ "name": {
+ "description": "Name is the name of the TaskRun or Run this is referencing.",
+ "type": "string"
+ },
+ "pipelineTaskName": {
+ "description": "PipelineTaskName is the name of the PipelineTask this is referencing.",
+ "type": "string"
+ },
+ "whenExpressions": {
+ "description": "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.WhenExpression"
+ },
+ "x-kubernetes-list-type": "atomic"
+ }
+ }
+ },
"v1.EmbeddedTask": {
"description": "EmbeddedTask is used to define a Task inline within a Pipeline's PipelineTasks.",
"type": "object",
@@ -362,6 +391,20 @@
}
}
},
+ "v1.PipelineRef": {
+ "description": "PipelineRef can be used to refer to a specific instance of a Pipeline.",
+ "type": "object",
+ "properties": {
+ "apiVersion": {
+ "description": "API version of the referent",
+ "type": "string"
+ },
+ "name": {
+ "description": "Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names",
+ "type": "string"
+ }
+ }
+ },
"v1.PipelineResult": {
"description": "PipelineResult used to describe the results of a pipeline",
"type": "object",
@@ -391,6 +434,298 @@
}
}
},
+ "v1.PipelineRun": {
+ "description": "PipelineRun represents a single execution of a Pipeline. PipelineRuns are how the graph of Tasks declared in a Pipeline are executed; they specify inputs to Pipelines such as parameter values and capture operational aspects of the Tasks execution such as service account and tolerations. Creating a PipelineRun creates TaskRuns for Tasks in the referenced Pipeline.",
+ "type": "object",
+ "properties": {
+ "apiVersion": {
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ "type": "string"
+ },
+ "kind": {
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ "type": "string"
+ },
+ "metadata": {
+ "default": {},
+ "$ref": "#/definitions/v1.ObjectMeta"
+ },
+ "spec": {
+ "default": {},
+ "$ref": "#/definitions/v1.PipelineRunSpec"
+ },
+ "status": {
+ "default": {},
+ "$ref": "#/definitions/v1.PipelineRunStatus"
+ }
+ }
+ },
+ "v1.PipelineRunList": {
+ "description": "PipelineRunList contains a list of PipelineRun",
+ "type": "object",
+ "properties": {
+ "apiVersion": {
+ "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
+ "type": "string"
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.PipelineRun"
+ }
+ },
+ "kind": {
+ "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
+ "type": "string"
+ },
+ "metadata": {
+ "default": {},
+ "$ref": "#/definitions/v1.ListMeta"
+ }
+ }
+ },
+ "v1.PipelineRunResult": {
+ "description": "PipelineRunResult used to describe the results of a pipeline",
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "description": "Name is the result's name as declared by the Pipeline",
+ "type": "string",
+ "default": ""
+ },
+ "value": {
+ "description": "Value is the result returned from the execution of this PipelineRun",
+ "default": {},
+ "$ref": "#/definitions/v1.ParamValue"
+ }
+ }
+ },
+ "v1.PipelineRunRunStatus": {
+ "description": "PipelineRunRunStatus contains the name of the PipelineTask for this Run and the Run's Status",
+ "type": "object",
+ "properties": {
+ "pipelineTaskName": {
+ "description": "PipelineTaskName is the name of the PipelineTask.",
+ "type": "string"
+ },
+ "status": {
+ "description": "Status is the RunStatus for the corresponding Run",
+ "$ref": "#/definitions/github.com.tektoncd.pipeline.pkg.apis.run.v1alpha1.RunStatus"
+ },
+ "whenExpressions": {
+ "description": "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.WhenExpression"
+ },
+ "x-kubernetes-list-type": "atomic"
+ }
+ }
+ },
+ "v1.PipelineRunSpec": {
+ "description": "PipelineRunSpec defines the desired state of PipelineRun",
+ "type": "object",
+ "properties": {
+ "params": {
+ "description": "Params is a list of parameter names and values.",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.Param"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "pipelineRef": {
+ "$ref": "#/definitions/v1.PipelineRef"
+ },
+ "pipelineSpec": {
+ "$ref": "#/definitions/v1.PipelineSpec"
+ },
+ "podTemplate": {
+ "description": "PodTemplate holds pod specific configuration",
+ "$ref": "#/definitions/pod.Template"
+ },
+ "serviceAccountName": {
+ "type": "string"
+ },
+ "status": {
+ "description": "Used for cancelling a pipelinerun (and maybe more later on)",
+ "type": "string"
+ },
+ "taskRunSpecs": {
+ "description": "TaskRunSpecs holds a set of runtime specs",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.PipelineTaskRunSpec"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "timeouts": {
+ "description": "Time after which the Pipeline times out. Currently three keys are accepted in the map pipeline, tasks and finally with Timeouts.pipeline \u003e= Timeouts.tasks + Timeouts.finally",
+ "$ref": "#/definitions/v1.TimeoutFields"
+ },
+ "workspaces": {
+ "description": "Workspaces holds a set of workspace bindings that must match names with those declared in the pipeline.",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.WorkspaceBinding"
+ },
+ "x-kubernetes-list-type": "atomic"
+ }
+ }
+ },
+ "v1.PipelineRunStatus": {
+ "description": "PipelineRunStatus defines the observed state of PipelineRun",
+ "type": "object",
+ "properties": {
+ "annotations": {
+ "description": "Annotations is additional Status fields for the Resource to save some additional State as well as convey more information to the user. This is roughly akin to Annotations on any k8s resource, just the reconciler conveying richer information outwards.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string",
+ "default": ""
+ }
+ },
+ "childReferences": {
+ "description": "list of TaskRun and Run names, PipelineTask names, and API versions/kinds for children of this PipelineRun.",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.ChildStatusReference"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "completionTime": {
+ "description": "CompletionTime is the time the PipelineRun completed.",
+ "$ref": "#/definitions/v1.Time"
+ },
+ "conditions": {
+ "description": "Conditions the latest available observations of a resource's current state.",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/knative.Condition"
+ },
+ "x-kubernetes-patch-merge-key": "type",
+ "x-kubernetes-patch-strategy": "merge"
+ },
+ "finallyStartTime": {
+ "description": "FinallyStartTime is when all non-finally tasks have been completed and only finally tasks are being executed.",
+ "$ref": "#/definitions/v1.Time"
+ },
+ "observedGeneration": {
+ "description": "ObservedGeneration is the 'Generation' of the Service that was last processed by the controller.",
+ "type": "integer",
+ "format": "int64"
+ },
+ "pipelineSpec": {
+ "description": "PipelineRunSpec contains the exact spec used to instantiate the run",
+ "$ref": "#/definitions/v1.PipelineSpec"
+ },
+ "results": {
+ "description": "Results are the list of results written out by the pipeline task's containers",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.PipelineRunResult"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "skippedTasks": {
+ "description": "list of tasks that were skipped due to when expressions evaluating to false",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.SkippedTask"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "startTime": {
+ "description": "StartTime is the time the PipelineRun is actually started.",
+ "$ref": "#/definitions/v1.Time"
+ }
+ }
+ },
+ "v1.PipelineRunStatusFields": {
+ "description": "PipelineRunStatusFields holds the fields of PipelineRunStatus' status. This is defined separately and inlined so that other types can readily consume these fields via duck typing.",
+ "type": "object",
+ "properties": {
+ "childReferences": {
+ "description": "list of TaskRun and Run names, PipelineTask names, and API versions/kinds for children of this PipelineRun.",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.ChildStatusReference"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "completionTime": {
+ "description": "CompletionTime is the time the PipelineRun completed.",
+ "$ref": "#/definitions/v1.Time"
+ },
+ "finallyStartTime": {
+ "description": "FinallyStartTime is when all non-finally tasks have been completed and only finally tasks are being executed.",
+ "$ref": "#/definitions/v1.Time"
+ },
+ "pipelineSpec": {
+ "description": "PipelineRunSpec contains the exact spec used to instantiate the run",
+ "$ref": "#/definitions/v1.PipelineSpec"
+ },
+ "results": {
+ "description": "Results are the list of results written out by the pipeline task's containers",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.PipelineRunResult"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "skippedTasks": {
+ "description": "list of tasks that were skipped due to when expressions evaluating to false",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.SkippedTask"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "startTime": {
+ "description": "StartTime is the time the PipelineRun is actually started.",
+ "$ref": "#/definitions/v1.Time"
+ }
+ }
+ },
+ "v1.PipelineRunTaskRunStatus": {
+ "description": "PipelineRunTaskRunStatus contains the name of the PipelineTask for this TaskRun and the TaskRun's Status",
+ "type": "object",
+ "properties": {
+ "pipelineTaskName": {
+ "description": "PipelineTaskName is the name of the PipelineTask.",
+ "type": "string"
+ },
+ "status": {
+ "description": "Status is the TaskRunStatus for the corresponding TaskRun",
+ "$ref": "#/definitions/v1.TaskRunStatus"
+ },
+ "whenExpressions": {
+ "description": "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.WhenExpression"
+ },
+ "x-kubernetes-list-type": "atomic"
+ }
+ }
+ },
"v1.PipelineSpec": {
"description": "PipelineSpec defines the desired state of Pipeline.",
"type": "object",
@@ -555,6 +890,53 @@
}
}
},
+ "v1.PipelineTaskRun": {
+ "description": "PipelineTaskRun reports the results of running a step in the Task. Each task has the potential to succeed or fail (based on the exit code) and produces logs.",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.PipelineTaskRunSpec": {
+ "description": "PipelineTaskRunSpec can be used to configure specific specs for a concrete Task",
+ "type": "object",
+ "properties": {
+ "computeResources": {
+ "description": "Compute resources to use for this TaskRun",
+ "$ref": "#/definitions/v1.ResourceRequirements"
+ },
+ "metadata": {
+ "$ref": "#/definitions/v1.PipelineTaskMetadata"
+ },
+ "pipelineTaskName": {
+ "type": "string"
+ },
+ "podTemplate": {
+ "$ref": "#/definitions/pod.Template"
+ },
+ "serviceAccountName": {
+ "type": "string"
+ },
+ "sidecarOverrides": {
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.TaskRunSidecarOverride"
+ },
+ "x-kubernetes-list-type": "atomic"
+ },
+ "stepOverrides": {
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.TaskRunStepOverride"
+ },
+ "x-kubernetes-list-type": "atomic"
+ }
+ }
+ },
"v1.PipelineWorkspaceDeclaration": {
"description": "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": "object",
@@ -820,6 +1202,35 @@
}
}
},
+ "v1.SkippedTask": {
+ "description": "SkippedTask is used to describe the Tasks that were skipped due to their When Expressions evaluating to False. This is a struct because we are looking into including more details about the When Expressions that caused this Task to be skipped.",
+ "type": "object",
+ "required": [
+ "name",
+ "reason"
+ ],
+ "properties": {
+ "name": {
+ "description": "Name is the Pipeline Task name",
+ "type": "string",
+ "default": ""
+ },
+ "reason": {
+ "description": "Reason is the cause of the PipelineTask being skipped.",
+ "type": "string",
+ "default": ""
+ },
+ "whenExpressions": {
+ "description": "WhenExpressions is the list of checks guarding the execution of the PipelineTask",
+ "type": "array",
+ "items": {
+ "default": {},
+ "$ref": "#/definitions/v1.WhenExpression"
+ },
+ "x-kubernetes-list-type": "atomic"
+ }
+ }
+ },
"v1.Step": {
"description": "Step runs a subcomponent of a Task",
"type": "object",
@@ -1603,6 +2014,24 @@
}
}
},
+ "v1.TimeoutFields": {
+ "description": "TimeoutFields allows granular specification of pipeline, task, and finally timeouts",
+ "type": "object",
+ "properties": {
+ "finally": {
+ "description": "Finally sets the maximum allowed duration of this pipeline's finally",
+ "$ref": "#/definitions/v1.Duration"
+ },
+ "pipeline": {
+ "description": "Pipeline sets the maximum allowed duration for execution of the entire pipeline. The sum of individual timeouts for tasks and finally must not exceed this value.",
+ "$ref": "#/definitions/v1.Duration"
+ },
+ "tasks": {
+ "description": "Tasks sets the maximum allowed duration of this pipeline's tasks",
+ "$ref": "#/definitions/v1.Duration"
+ }
+ }
+ },
"v1.WhenExpression": {
"description": "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",
"type": "object",
diff --git a/pkg/apis/pipeline/v1/zz_generated.deepcopy.go b/pkg/apis/pipeline/v1/zz_generated.deepcopy.go
index 73368c5f29c..d7f974abc3b 100644
--- a/pkg/apis/pipeline/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/pipeline/v1/zz_generated.deepcopy.go
@@ -23,11 +23,36 @@ package v1
import (
pod "github.com/tektoncd/pipeline/pkg/apis/pipeline/pod"
+ v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/run/v1alpha1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *ChildStatusReference) DeepCopyInto(out *ChildStatusReference) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ if in.WhenExpressions != nil {
+ in, out := &in.WhenExpressions, &out.WhenExpressions
+ *out = make([]WhenExpression, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChildStatusReference.
+func (in *ChildStatusReference) DeepCopy() *ChildStatusReference {
+ if in == nil {
+ return nil
+ }
+ out := new(ChildStatusReference)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *EmbeddedTask) DeepCopyInto(out *EmbeddedTask) {
*out = *in
@@ -181,6 +206,23 @@ func (in *PipelineList) DeepCopyObject() runtime.Object {
return nil
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRef) DeepCopyInto(out *PipelineRef) {
+ *out = *in
+ in.ResolverRef.DeepCopyInto(&out.ResolverRef)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRef.
+func (in *PipelineRef) DeepCopy() *PipelineRef {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRef)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PipelineResult) DeepCopyInto(out *PipelineResult) {
*out = *in
@@ -198,6 +240,269 @@ func (in *PipelineResult) DeepCopy() *PipelineResult {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRun) DeepCopyInto(out *PipelineRun) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
+ in.Spec.DeepCopyInto(&out.Spec)
+ in.Status.DeepCopyInto(&out.Status)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRun.
+func (in *PipelineRun) DeepCopy() *PipelineRun {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRun)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *PipelineRun) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunList) DeepCopyInto(out *PipelineRunList) {
+ *out = *in
+ out.TypeMeta = in.TypeMeta
+ in.ListMeta.DeepCopyInto(&out.ListMeta)
+ if in.Items != nil {
+ in, out := &in.Items, &out.Items
+ *out = make([]PipelineRun, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunList.
+func (in *PipelineRunList) DeepCopy() *PipelineRunList {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunList)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
+func (in *PipelineRunList) DeepCopyObject() runtime.Object {
+ if c := in.DeepCopy(); c != nil {
+ return c
+ }
+ return nil
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunResult) DeepCopyInto(out *PipelineRunResult) {
+ *out = *in
+ in.Value.DeepCopyInto(&out.Value)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunResult.
+func (in *PipelineRunResult) DeepCopy() *PipelineRunResult {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunResult)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunRunStatus) DeepCopyInto(out *PipelineRunRunStatus) {
+ *out = *in
+ if in.Status != nil {
+ in, out := &in.Status, &out.Status
+ *out = new(v1alpha1.RunStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.WhenExpressions != nil {
+ in, out := &in.WhenExpressions, &out.WhenExpressions
+ *out = make([]WhenExpression, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunRunStatus.
+func (in *PipelineRunRunStatus) DeepCopy() *PipelineRunRunStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunRunStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunSpec) DeepCopyInto(out *PipelineRunSpec) {
+ *out = *in
+ if in.PipelineRef != nil {
+ in, out := &in.PipelineRef, &out.PipelineRef
+ *out = new(PipelineRef)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.PipelineSpec != nil {
+ in, out := &in.PipelineSpec, &out.PipelineSpec
+ *out = new(PipelineSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Params != nil {
+ in, out := &in.Params, &out.Params
+ *out = make([]Param, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Timeouts != nil {
+ in, out := &in.Timeouts, &out.Timeouts
+ *out = new(TimeoutFields)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.PodTemplate != nil {
+ in, out := &in.PodTemplate, &out.PodTemplate
+ *out = new(pod.Template)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.Workspaces != nil {
+ in, out := &in.Workspaces, &out.Workspaces
+ *out = make([]WorkspaceBinding, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.TaskRunSpecs != nil {
+ in, out := &in.TaskRunSpecs, &out.TaskRunSpecs
+ *out = make([]PipelineTaskRunSpec, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunSpec.
+func (in *PipelineRunSpec) DeepCopy() *PipelineRunSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunStatus) DeepCopyInto(out *PipelineRunStatus) {
+ *out = *in
+ in.Status.DeepCopyInto(&out.Status)
+ in.PipelineRunStatusFields.DeepCopyInto(&out.PipelineRunStatusFields)
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunStatus.
+func (in *PipelineRunStatus) DeepCopy() *PipelineRunStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunStatusFields) DeepCopyInto(out *PipelineRunStatusFields) {
+ *out = *in
+ if in.StartTime != nil {
+ in, out := &in.StartTime, &out.StartTime
+ *out = (*in).DeepCopy()
+ }
+ if in.CompletionTime != nil {
+ in, out := &in.CompletionTime, &out.CompletionTime
+ *out = (*in).DeepCopy()
+ }
+ if in.Results != nil {
+ in, out := &in.Results, &out.Results
+ *out = make([]PipelineRunResult, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.PipelineSpec != nil {
+ in, out := &in.PipelineSpec, &out.PipelineSpec
+ *out = new(PipelineSpec)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.SkippedTasks != nil {
+ in, out := &in.SkippedTasks, &out.SkippedTasks
+ *out = make([]SkippedTask, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.ChildReferences != nil {
+ in, out := &in.ChildReferences, &out.ChildReferences
+ *out = make([]ChildStatusReference, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.FinallyStartTime != nil {
+ in, out := &in.FinallyStartTime, &out.FinallyStartTime
+ *out = (*in).DeepCopy()
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunStatusFields.
+func (in *PipelineRunStatusFields) DeepCopy() *PipelineRunStatusFields {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunStatusFields)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineRunTaskRunStatus) DeepCopyInto(out *PipelineRunTaskRunStatus) {
+ *out = *in
+ if in.Status != nil {
+ in, out := &in.Status, &out.Status
+ *out = new(TaskRunStatus)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.WhenExpressions != nil {
+ in, out := &in.WhenExpressions, &out.WhenExpressions
+ *out = make([]WhenExpression, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineRunTaskRunStatus.
+func (in *PipelineRunTaskRunStatus) DeepCopy() *PipelineRunTaskRunStatus {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineRunTaskRunStatus)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) {
*out = *in
@@ -377,6 +682,67 @@ func (in *PipelineTaskParam) DeepCopy() *PipelineTaskParam {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineTaskRun) DeepCopyInto(out *PipelineTaskRun) {
+ *out = *in
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTaskRun.
+func (in *PipelineTaskRun) DeepCopy() *PipelineTaskRun {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineTaskRun)
+ in.DeepCopyInto(out)
+ return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *PipelineTaskRunSpec) DeepCopyInto(out *PipelineTaskRunSpec) {
+ *out = *in
+ if in.PodTemplate != nil {
+ in, out := &in.PodTemplate, &out.PodTemplate
+ *out = new(pod.Template)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.StepOverrides != nil {
+ in, out := &in.StepOverrides, &out.StepOverrides
+ *out = make([]TaskRunStepOverride, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.SidecarOverrides != nil {
+ in, out := &in.SidecarOverrides, &out.SidecarOverrides
+ *out = make([]TaskRunSidecarOverride, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ if in.Metadata != nil {
+ in, out := &in.Metadata, &out.Metadata
+ *out = new(PipelineTaskMetadata)
+ (*in).DeepCopyInto(*out)
+ }
+ if in.ComputeResources != nil {
+ in, out := &in.ComputeResources, &out.ComputeResources
+ *out = new(corev1.ResourceRequirements)
+ (*in).DeepCopyInto(*out)
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineTaskRunSpec.
+func (in *PipelineTaskRunSpec) DeepCopy() *PipelineTaskRunSpec {
+ if in == nil {
+ return nil
+ }
+ out := new(PipelineTaskRunSpec)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PipelineWorkspaceDeclaration) DeepCopyInto(out *PipelineWorkspaceDeclaration) {
*out = *in
@@ -553,6 +919,29 @@ func (in *SidecarState) DeepCopy() *SidecarState {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *SkippedTask) DeepCopyInto(out *SkippedTask) {
+ *out = *in
+ if in.WhenExpressions != nil {
+ in, out := &in.WhenExpressions, &out.WhenExpressions
+ *out = make([]WhenExpression, len(*in))
+ for i := range *in {
+ (*in)[i].DeepCopyInto(&(*out)[i])
+ }
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SkippedTask.
+func (in *SkippedTask) DeepCopy() *SkippedTask {
+ if in == nil {
+ return nil
+ }
+ out := new(SkippedTask)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Step) DeepCopyInto(out *Step) {
*out = *in
@@ -1188,6 +1577,37 @@ func (in *TaskSpec) DeepCopy() *TaskSpec {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *TimeoutFields) DeepCopyInto(out *TimeoutFields) {
+ *out = *in
+ if in.Pipeline != nil {
+ in, out := &in.Pipeline, &out.Pipeline
+ *out = new(metav1.Duration)
+ **out = **in
+ }
+ if in.Tasks != nil {
+ in, out := &in.Tasks, &out.Tasks
+ *out = new(metav1.Duration)
+ **out = **in
+ }
+ if in.Finally != nil {
+ in, out := &in.Finally, &out.Finally
+ *out = new(metav1.Duration)
+ **out = **in
+ }
+ return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeoutFields.
+func (in *TimeoutFields) DeepCopy() *TimeoutFields {
+ if in == nil {
+ return nil
+ }
+ out := new(TimeoutFields)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *WhenExpression) DeepCopyInto(out *WhenExpression) {
*out = *in
diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipeline_client.go b/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipeline_client.go
index 87ade292418..8b2549cfd0b 100644
--- a/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipeline_client.go
+++ b/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipeline_client.go
@@ -32,6 +32,10 @@ func (c *FakeTektonV1) Pipelines(namespace string) v1.PipelineInterface {
return &FakePipelines{c, namespace}
}
+func (c *FakeTektonV1) PipelineRuns(namespace string) v1.PipelineRunInterface {
+ return &FakePipelineRuns{c, namespace}
+}
+
func (c *FakeTektonV1) Tasks(namespace string) v1.TaskInterface {
return &FakeTasks{c, namespace}
}
diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipelinerun.go b/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipelinerun.go
new file mode 100644
index 00000000000..c4d32bdd411
--- /dev/null
+++ b/pkg/client/clientset/versioned/typed/pipeline/v1/fake/fake_pipelinerun.go
@@ -0,0 +1,142 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ "context"
+
+ pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ schema "k8s.io/apimachinery/pkg/runtime/schema"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ testing "k8s.io/client-go/testing"
+)
+
+// FakePipelineRuns implements PipelineRunInterface
+type FakePipelineRuns struct {
+ Fake *FakeTektonV1
+ ns string
+}
+
+var pipelinerunsResource = schema.GroupVersionResource{Group: "tekton.dev", Version: "v1", Resource: "pipelineruns"}
+
+var pipelinerunsKind = schema.GroupVersionKind{Group: "tekton.dev", Version: "v1", Kind: "PipelineRun"}
+
+// Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any.
+func (c *FakePipelineRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *pipelinev1.PipelineRun, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewGetAction(pipelinerunsResource, c.ns, name), &pipelinev1.PipelineRun{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*pipelinev1.PipelineRun), err
+}
+
+// List takes label and field selectors, and returns the list of PipelineRuns that match those selectors.
+func (c *FakePipelineRuns) List(ctx context.Context, opts v1.ListOptions) (result *pipelinev1.PipelineRunList, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewListAction(pipelinerunsResource, pipelinerunsKind, c.ns, opts), &pipelinev1.PipelineRunList{})
+
+ if obj == nil {
+ return nil, err
+ }
+
+ label, _, _ := testing.ExtractFromListOptions(opts)
+ if label == nil {
+ label = labels.Everything()
+ }
+ list := &pipelinev1.PipelineRunList{ListMeta: obj.(*pipelinev1.PipelineRunList).ListMeta}
+ for _, item := range obj.(*pipelinev1.PipelineRunList).Items {
+ if label.Matches(labels.Set(item.Labels)) {
+ list.Items = append(list.Items, item)
+ }
+ }
+ return list, err
+}
+
+// Watch returns a watch.Interface that watches the requested pipelineRuns.
+func (c *FakePipelineRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ return c.Fake.
+ InvokesWatch(testing.NewWatchAction(pipelinerunsResource, c.ns, opts))
+
+}
+
+// Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any.
+func (c *FakePipelineRuns) Create(ctx context.Context, pipelineRun *pipelinev1.PipelineRun, opts v1.CreateOptions) (result *pipelinev1.PipelineRun, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewCreateAction(pipelinerunsResource, c.ns, pipelineRun), &pipelinev1.PipelineRun{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*pipelinev1.PipelineRun), err
+}
+
+// Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any.
+func (c *FakePipelineRuns) Update(ctx context.Context, pipelineRun *pipelinev1.PipelineRun, opts v1.UpdateOptions) (result *pipelinev1.PipelineRun, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateAction(pipelinerunsResource, c.ns, pipelineRun), &pipelinev1.PipelineRun{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*pipelinev1.PipelineRun), err
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *FakePipelineRuns) UpdateStatus(ctx context.Context, pipelineRun *pipelinev1.PipelineRun, opts v1.UpdateOptions) (*pipelinev1.PipelineRun, error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewUpdateSubresourceAction(pipelinerunsResource, "status", c.ns, pipelineRun), &pipelinev1.PipelineRun{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*pipelinev1.PipelineRun), err
+}
+
+// Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs.
+func (c *FakePipelineRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ _, err := c.Fake.
+ Invokes(testing.NewDeleteActionWithOptions(pipelinerunsResource, c.ns, name, opts), &pipelinev1.PipelineRun{})
+
+ return err
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *FakePipelineRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ action := testing.NewDeleteCollectionAction(pipelinerunsResource, c.ns, listOpts)
+
+ _, err := c.Fake.Invokes(action, &pipelinev1.PipelineRunList{})
+ return err
+}
+
+// Patch applies the patch and returns the patched pipelineRun.
+func (c *FakePipelineRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pipelinev1.PipelineRun, err error) {
+ obj, err := c.Fake.
+ Invokes(testing.NewPatchSubresourceAction(pipelinerunsResource, c.ns, name, pt, data, subresources...), &pipelinev1.PipelineRun{})
+
+ if obj == nil {
+ return nil, err
+ }
+ return obj.(*pipelinev1.PipelineRun), err
+}
diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/pipeline/v1/generated_expansion.go
index 83baab3f218..ec5a572458b 100644
--- a/pkg/client/clientset/versioned/typed/pipeline/v1/generated_expansion.go
+++ b/pkg/client/clientset/versioned/typed/pipeline/v1/generated_expansion.go
@@ -20,6 +20,8 @@ package v1
type PipelineExpansion interface{}
+type PipelineRunExpansion interface{}
+
type TaskExpansion interface{}
type TaskRunExpansion interface{}
diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1/pipeline_client.go b/pkg/client/clientset/versioned/typed/pipeline/v1/pipeline_client.go
index 68052ef8ccc..1b7f8d56ffb 100644
--- a/pkg/client/clientset/versioned/typed/pipeline/v1/pipeline_client.go
+++ b/pkg/client/clientset/versioned/typed/pipeline/v1/pipeline_client.go
@@ -29,6 +29,7 @@ import (
type TektonV1Interface interface {
RESTClient() rest.Interface
PipelinesGetter
+ PipelineRunsGetter
TasksGetter
TaskRunsGetter
}
@@ -42,6 +43,10 @@ func (c *TektonV1Client) Pipelines(namespace string) PipelineInterface {
return newPipelines(c, namespace)
}
+func (c *TektonV1Client) PipelineRuns(namespace string) PipelineRunInterface {
+ return newPipelineRuns(c, namespace)
+}
+
func (c *TektonV1Client) Tasks(namespace string) TaskInterface {
return newTasks(c, namespace)
}
diff --git a/pkg/client/clientset/versioned/typed/pipeline/v1/pipelinerun.go b/pkg/client/clientset/versioned/typed/pipeline/v1/pipelinerun.go
new file mode 100644
index 00000000000..0f37e00bc6a
--- /dev/null
+++ b/pkg/client/clientset/versioned/typed/pipeline/v1/pipelinerun.go
@@ -0,0 +1,195 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by client-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ "context"
+ "time"
+
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ scheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ rest "k8s.io/client-go/rest"
+)
+
+// PipelineRunsGetter has a method to return a PipelineRunInterface.
+// A group's client should implement this interface.
+type PipelineRunsGetter interface {
+ PipelineRuns(namespace string) PipelineRunInterface
+}
+
+// PipelineRunInterface has methods to work with PipelineRun resources.
+type PipelineRunInterface interface {
+ Create(ctx context.Context, pipelineRun *v1.PipelineRun, opts metav1.CreateOptions) (*v1.PipelineRun, error)
+ Update(ctx context.Context, pipelineRun *v1.PipelineRun, opts metav1.UpdateOptions) (*v1.PipelineRun, error)
+ UpdateStatus(ctx context.Context, pipelineRun *v1.PipelineRun, opts metav1.UpdateOptions) (*v1.PipelineRun, error)
+ Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
+ DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
+ Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PipelineRun, error)
+ List(ctx context.Context, opts metav1.ListOptions) (*v1.PipelineRunList, error)
+ Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
+ Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineRun, err error)
+ PipelineRunExpansion
+}
+
+// pipelineRuns implements PipelineRunInterface
+type pipelineRuns struct {
+ client rest.Interface
+ ns string
+}
+
+// newPipelineRuns returns a PipelineRuns
+func newPipelineRuns(c *TektonV1Client, namespace string) *pipelineRuns {
+ return &pipelineRuns{
+ client: c.RESTClient(),
+ ns: namespace,
+ }
+}
+
+// Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any.
+func (c *pipelineRuns) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PipelineRun, err error) {
+ result = &v1.PipelineRun{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ Name(name).
+ VersionedParams(&options, scheme.ParameterCodec).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// List takes label and field selectors, and returns the list of PipelineRuns that match those selectors.
+func (c *pipelineRuns) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PipelineRunList, err error) {
+ var timeout time.Duration
+ if opts.TimeoutSeconds != nil {
+ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
+ }
+ result = &v1.PipelineRunList{}
+ err = c.client.Get().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Watch returns a watch.Interface that watches the requested pipelineRuns.
+func (c *pipelineRuns) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
+ var timeout time.Duration
+ if opts.TimeoutSeconds != nil {
+ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
+ }
+ opts.Watch = true
+ return c.client.Get().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Watch(ctx)
+}
+
+// Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any.
+func (c *pipelineRuns) Create(ctx context.Context, pipelineRun *v1.PipelineRun, opts metav1.CreateOptions) (result *v1.PipelineRun, err error) {
+ result = &v1.PipelineRun{}
+ err = c.client.Post().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(pipelineRun).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any.
+func (c *pipelineRuns) Update(ctx context.Context, pipelineRun *v1.PipelineRun, opts metav1.UpdateOptions) (result *v1.PipelineRun, err error) {
+ result = &v1.PipelineRun{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ Name(pipelineRun.Name).
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(pipelineRun).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// UpdateStatus was generated because the type contains a Status member.
+// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
+func (c *pipelineRuns) UpdateStatus(ctx context.Context, pipelineRun *v1.PipelineRun, opts metav1.UpdateOptions) (result *v1.PipelineRun, err error) {
+ result = &v1.PipelineRun{}
+ err = c.client.Put().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ Name(pipelineRun.Name).
+ SubResource("status").
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(pipelineRun).
+ Do(ctx).
+ Into(result)
+ return
+}
+
+// Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs.
+func (c *pipelineRuns) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ Name(name).
+ Body(&opts).
+ Do(ctx).
+ Error()
+}
+
+// DeleteCollection deletes a collection of objects.
+func (c *pipelineRuns) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
+ var timeout time.Duration
+ if listOpts.TimeoutSeconds != nil {
+ timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
+ }
+ return c.client.Delete().
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ VersionedParams(&listOpts, scheme.ParameterCodec).
+ Timeout(timeout).
+ Body(&opts).
+ Do(ctx).
+ Error()
+}
+
+// Patch applies the patch and returns the patched pipelineRun.
+func (c *pipelineRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineRun, err error) {
+ result = &v1.PipelineRun{}
+ err = c.client.Patch(pt).
+ Namespace(c.ns).
+ Resource("pipelineruns").
+ Name(name).
+ SubResource(subresources...).
+ VersionedParams(&opts, scheme.ParameterCodec).
+ Body(data).
+ Do(ctx).
+ Into(result)
+ return
+}
diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go
index 1366adfcdd5..ee587d9440d 100644
--- a/pkg/client/informers/externalversions/generic.go
+++ b/pkg/client/informers/externalversions/generic.go
@@ -57,6 +57,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=tekton.dev, Version=v1
case v1.SchemeGroupVersion.WithResource("pipelines"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1().Pipelines().Informer()}, nil
+ case v1.SchemeGroupVersion.WithResource("pipelineruns"):
+ return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1().PipelineRuns().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("tasks"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Tekton().V1().Tasks().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("taskruns"):
diff --git a/pkg/client/informers/externalversions/pipeline/v1/interface.go b/pkg/client/informers/externalversions/pipeline/v1/interface.go
index aa64f81144a..67690389f53 100644
--- a/pkg/client/informers/externalversions/pipeline/v1/interface.go
+++ b/pkg/client/informers/externalversions/pipeline/v1/interface.go
@@ -26,6 +26,8 @@ import (
type Interface interface {
// Pipelines returns a PipelineInformer.
Pipelines() PipelineInformer
+ // PipelineRuns returns a PipelineRunInformer.
+ PipelineRuns() PipelineRunInformer
// Tasks returns a TaskInformer.
Tasks() TaskInformer
// TaskRuns returns a TaskRunInformer.
@@ -48,6 +50,11 @@ func (v *version) Pipelines() PipelineInformer {
return &pipelineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
+// PipelineRuns returns a PipelineRunInformer.
+func (v *version) PipelineRuns() PipelineRunInformer {
+ return &pipelineRunInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
+}
+
// Tasks returns a TaskInformer.
func (v *version) Tasks() TaskInformer {
return &taskInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
diff --git a/pkg/client/informers/externalversions/pipeline/v1/pipelinerun.go b/pkg/client/informers/externalversions/pipeline/v1/pipelinerun.go
new file mode 100644
index 00000000000..4e02db3c5b8
--- /dev/null
+++ b/pkg/client/informers/externalversions/pipeline/v1/pipelinerun.go
@@ -0,0 +1,90 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by informer-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ "context"
+ time "time"
+
+ pipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
+ internalinterfaces "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/internalinterfaces"
+ v1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ runtime "k8s.io/apimachinery/pkg/runtime"
+ watch "k8s.io/apimachinery/pkg/watch"
+ cache "k8s.io/client-go/tools/cache"
+)
+
+// PipelineRunInformer provides access to a shared informer and lister for
+// PipelineRuns.
+type PipelineRunInformer interface {
+ Informer() cache.SharedIndexInformer
+ Lister() v1.PipelineRunLister
+}
+
+type pipelineRunInformer struct {
+ factory internalinterfaces.SharedInformerFactory
+ tweakListOptions internalinterfaces.TweakListOptionsFunc
+ namespace string
+}
+
+// NewPipelineRunInformer constructs a new informer for PipelineRun type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewPipelineRunInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
+ return NewFilteredPipelineRunInformer(client, namespace, resyncPeriod, indexers, nil)
+}
+
+// NewFilteredPipelineRunInformer constructs a new informer for PipelineRun type.
+// Always prefer using an informer factory to get a shared informer instead of getting an independent
+// one. This reduces memory footprint and number of connections to the server.
+func NewFilteredPipelineRunInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(
+ &cache.ListWatch{
+ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.TektonV1().PipelineRuns(namespace).List(context.TODO(), options)
+ },
+ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
+ if tweakListOptions != nil {
+ tweakListOptions(&options)
+ }
+ return client.TektonV1().PipelineRuns(namespace).Watch(context.TODO(), options)
+ },
+ },
+ &pipelinev1.PipelineRun{},
+ resyncPeriod,
+ indexers,
+ )
+}
+
+func (f *pipelineRunInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
+ return NewFilteredPipelineRunInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
+}
+
+func (f *pipelineRunInformer) Informer() cache.SharedIndexInformer {
+ return f.factory.InformerFor(&pipelinev1.PipelineRun{}, f.defaultInformer)
+}
+
+func (f *pipelineRunInformer) Lister() v1.PipelineRunLister {
+ return v1.NewPipelineRunLister(f.Informer().GetIndexer())
+}
diff --git a/pkg/client/injection/client/client.go b/pkg/client/injection/client/client.go
index edf87a0b826..ec93708a498 100644
--- a/pkg/client/injection/client/client.go
+++ b/pkg/client/injection/client/client.go
@@ -1058,6 +1058,137 @@ func (w *wrapTektonV1PipelineImpl) Watch(ctx context.Context, opts v1.ListOption
return nil, errors.New("NYI: Watch")
}
+func (w *wrapTektonV1) PipelineRuns(namespace string) typedtektonv1.PipelineRunInterface {
+ return &wrapTektonV1PipelineRunImpl{
+ dyn: w.dyn.Resource(schema.GroupVersionResource{
+ Group: "tekton.dev",
+ Version: "v1",
+ Resource: "pipelineruns",
+ }),
+
+ namespace: namespace,
+ }
+}
+
+type wrapTektonV1PipelineRunImpl struct {
+ dyn dynamic.NamespaceableResourceInterface
+
+ namespace string
+}
+
+var _ typedtektonv1.PipelineRunInterface = (*wrapTektonV1PipelineRunImpl)(nil)
+
+func (w *wrapTektonV1PipelineRunImpl) Create(ctx context.Context, in *pipelinev1.PipelineRun, opts v1.CreateOptions) (*pipelinev1.PipelineRun, error) {
+ in.SetGroupVersionKind(schema.GroupVersionKind{
+ Group: "tekton.dev",
+ Version: "v1",
+ Kind: "PipelineRun",
+ })
+ uo := &unstructured.Unstructured{}
+ if err := convert(in, uo); err != nil {
+ return nil, err
+ }
+ uo, err := w.dyn.Namespace(w.namespace).Create(ctx, uo, opts)
+ if err != nil {
+ return nil, err
+ }
+ out := &pipelinev1.PipelineRun{}
+ if err := convert(uo, out); err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (w *wrapTektonV1PipelineRunImpl) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
+ return w.dyn.Namespace(w.namespace).Delete(ctx, name, opts)
+}
+
+func (w *wrapTektonV1PipelineRunImpl) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
+ return w.dyn.Namespace(w.namespace).DeleteCollection(ctx, opts, listOpts)
+}
+
+func (w *wrapTektonV1PipelineRunImpl) Get(ctx context.Context, name string, opts v1.GetOptions) (*pipelinev1.PipelineRun, error) {
+ uo, err := w.dyn.Namespace(w.namespace).Get(ctx, name, opts)
+ if err != nil {
+ return nil, err
+ }
+ out := &pipelinev1.PipelineRun{}
+ if err := convert(uo, out); err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (w *wrapTektonV1PipelineRunImpl) List(ctx context.Context, opts v1.ListOptions) (*pipelinev1.PipelineRunList, error) {
+ uo, err := w.dyn.Namespace(w.namespace).List(ctx, opts)
+ if err != nil {
+ return nil, err
+ }
+ out := &pipelinev1.PipelineRunList{}
+ if err := convert(uo, out); err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (w *wrapTektonV1PipelineRunImpl) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *pipelinev1.PipelineRun, err error) {
+ uo, err := w.dyn.Namespace(w.namespace).Patch(ctx, name, pt, data, opts)
+ if err != nil {
+ return nil, err
+ }
+ out := &pipelinev1.PipelineRun{}
+ if err := convert(uo, out); err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (w *wrapTektonV1PipelineRunImpl) Update(ctx context.Context, in *pipelinev1.PipelineRun, opts v1.UpdateOptions) (*pipelinev1.PipelineRun, error) {
+ in.SetGroupVersionKind(schema.GroupVersionKind{
+ Group: "tekton.dev",
+ Version: "v1",
+ Kind: "PipelineRun",
+ })
+ uo := &unstructured.Unstructured{}
+ if err := convert(in, uo); err != nil {
+ return nil, err
+ }
+ uo, err := w.dyn.Namespace(w.namespace).Update(ctx, uo, opts)
+ if err != nil {
+ return nil, err
+ }
+ out := &pipelinev1.PipelineRun{}
+ if err := convert(uo, out); err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (w *wrapTektonV1PipelineRunImpl) UpdateStatus(ctx context.Context, in *pipelinev1.PipelineRun, opts v1.UpdateOptions) (*pipelinev1.PipelineRun, error) {
+ in.SetGroupVersionKind(schema.GroupVersionKind{
+ Group: "tekton.dev",
+ Version: "v1",
+ Kind: "PipelineRun",
+ })
+ uo := &unstructured.Unstructured{}
+ if err := convert(in, uo); err != nil {
+ return nil, err
+ }
+ uo, err := w.dyn.Namespace(w.namespace).UpdateStatus(ctx, uo, opts)
+ if err != nil {
+ return nil, err
+ }
+ out := &pipelinev1.PipelineRun{}
+ if err := convert(uo, out); err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (w *wrapTektonV1PipelineRunImpl) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
+ return nil, errors.New("NYI: Watch")
+}
+
func (w *wrapTektonV1) Tasks(namespace string) typedtektonv1.TaskInterface {
return &wrapTektonV1TaskImpl{
dyn: w.dyn.Resource(schema.GroupVersionResource{
diff --git a/pkg/client/injection/informers/pipeline/v1/pipelinerun/fake/fake.go b/pkg/client/injection/informers/pipeline/v1/pipelinerun/fake/fake.go
new file mode 100644
index 00000000000..0f6169f59d9
--- /dev/null
+++ b/pkg/client/injection/informers/pipeline/v1/pipelinerun/fake/fake.go
@@ -0,0 +1,40 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ context "context"
+
+ fake "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/fake"
+ pipelinerun "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun"
+ controller "knative.dev/pkg/controller"
+ injection "knative.dev/pkg/injection"
+)
+
+var Get = pipelinerun.Get
+
+func init() {
+ injection.Fake.RegisterInformer(withInformer)
+}
+
+func withInformer(ctx context.Context) (context.Context, controller.Informer) {
+ f := fake.Get(ctx)
+ inf := f.Tekton().V1().PipelineRuns()
+ return context.WithValue(ctx, pipelinerun.Key{}, inf), inf.Informer()
+}
diff --git a/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered/fake/fake.go b/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered/fake/fake.go
new file mode 100644
index 00000000000..88e0e5b8a81
--- /dev/null
+++ b/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered/fake/fake.go
@@ -0,0 +1,52 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package fake
+
+import (
+ context "context"
+
+ factoryfiltered "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/filtered"
+ filtered "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered"
+ controller "knative.dev/pkg/controller"
+ injection "knative.dev/pkg/injection"
+ logging "knative.dev/pkg/logging"
+)
+
+var Get = filtered.Get
+
+func init() {
+ injection.Fake.RegisterFilteredInformers(withInformer)
+}
+
+func withInformer(ctx context.Context) (context.Context, []controller.Informer) {
+ untyped := ctx.Value(factoryfiltered.LabelKey{})
+ if untyped == nil {
+ logging.FromContext(ctx).Panic(
+ "Unable to fetch labelkey from context.")
+ }
+ labelSelectors := untyped.([]string)
+ infs := []controller.Informer{}
+ for _, selector := range labelSelectors {
+ f := factoryfiltered.Get(ctx, selector)
+ inf := f.Tekton().V1().PipelineRuns()
+ ctx = context.WithValue(ctx, filtered.Key{Selector: selector}, inf)
+ infs = append(infs, inf.Informer())
+ }
+ return ctx, infs
+}
diff --git a/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered/pipelinerun.go b/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered/pipelinerun.go
new file mode 100644
index 00000000000..5096177646b
--- /dev/null
+++ b/pkg/client/injection/informers/pipeline/v1/pipelinerun/filtered/pipelinerun.go
@@ -0,0 +1,136 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package filtered
+
+import (
+ context "context"
+
+ apispipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
+ v1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1"
+ client "github.com/tektoncd/pipeline/pkg/client/injection/client"
+ filtered "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory/filtered"
+ pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ cache "k8s.io/client-go/tools/cache"
+ controller "knative.dev/pkg/controller"
+ injection "knative.dev/pkg/injection"
+ logging "knative.dev/pkg/logging"
+)
+
+func init() {
+ injection.Default.RegisterFilteredInformers(withInformer)
+ injection.Dynamic.RegisterDynamicInformer(withDynamicInformer)
+}
+
+// Key is used for associating the Informer inside the context.Context.
+type Key struct {
+ Selector string
+}
+
+func withInformer(ctx context.Context) (context.Context, []controller.Informer) {
+ untyped := ctx.Value(filtered.LabelKey{})
+ if untyped == nil {
+ logging.FromContext(ctx).Panic(
+ "Unable to fetch labelkey from context.")
+ }
+ labelSelectors := untyped.([]string)
+ infs := []controller.Informer{}
+ for _, selector := range labelSelectors {
+ f := filtered.Get(ctx, selector)
+ inf := f.Tekton().V1().PipelineRuns()
+ ctx = context.WithValue(ctx, Key{Selector: selector}, inf)
+ infs = append(infs, inf.Informer())
+ }
+ return ctx, infs
+}
+
+func withDynamicInformer(ctx context.Context) context.Context {
+ untyped := ctx.Value(filtered.LabelKey{})
+ if untyped == nil {
+ logging.FromContext(ctx).Panic(
+ "Unable to fetch labelkey from context.")
+ }
+ labelSelectors := untyped.([]string)
+ for _, selector := range labelSelectors {
+ inf := &wrapper{client: client.Get(ctx), selector: selector}
+ ctx = context.WithValue(ctx, Key{Selector: selector}, inf)
+ }
+ return ctx
+}
+
+// Get extracts the typed informer from the context.
+func Get(ctx context.Context, selector string) v1.PipelineRunInformer {
+ untyped := ctx.Value(Key{Selector: selector})
+ if untyped == nil {
+ logging.FromContext(ctx).Panicf(
+ "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1.PipelineRunInformer with selector %s from context.", selector)
+ }
+ return untyped.(v1.PipelineRunInformer)
+}
+
+type wrapper struct {
+ client versioned.Interface
+
+ namespace string
+
+ selector string
+}
+
+var _ v1.PipelineRunInformer = (*wrapper)(nil)
+var _ pipelinev1.PipelineRunLister = (*wrapper)(nil)
+
+func (w *wrapper) Informer() cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(nil, &apispipelinev1.PipelineRun{}, 0, nil)
+}
+
+func (w *wrapper) Lister() pipelinev1.PipelineRunLister {
+ return w
+}
+
+func (w *wrapper) PipelineRuns(namespace string) pipelinev1.PipelineRunNamespaceLister {
+ return &wrapper{client: w.client, namespace: namespace, selector: w.selector}
+}
+
+func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1.PipelineRun, err error) {
+ reqs, err := labels.ParseToRequirements(w.selector)
+ if err != nil {
+ return nil, err
+ }
+ selector = selector.Add(reqs...)
+ lo, err := w.client.TektonV1().PipelineRuns(w.namespace).List(context.TODO(), metav1.ListOptions{
+ LabelSelector: selector.String(),
+ // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria.
+ })
+ if err != nil {
+ return nil, err
+ }
+ for idx := range lo.Items {
+ ret = append(ret, &lo.Items[idx])
+ }
+ return ret, nil
+}
+
+func (w *wrapper) Get(name string) (*apispipelinev1.PipelineRun, error) {
+ // TODO(mattmoor): Check that the fetched object matches the selector.
+ return w.client.TektonV1().PipelineRuns(w.namespace).Get(context.TODO(), name, metav1.GetOptions{
+ // TODO(mattmoor): Incorporate resourceVersion bounds based on staleness criteria.
+ })
+}
diff --git a/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go b/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go
new file mode 100644
index 00000000000..44b15d5230e
--- /dev/null
+++ b/pkg/client/injection/informers/pipeline/v1/pipelinerun/pipelinerun.go
@@ -0,0 +1,116 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package pipelinerun
+
+import (
+ context "context"
+
+ apispipelinev1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
+ v1 "github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1"
+ client "github.com/tektoncd/pipeline/pkg/client/injection/client"
+ factory "github.com/tektoncd/pipeline/pkg/client/injection/informers/factory"
+ pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ cache "k8s.io/client-go/tools/cache"
+ controller "knative.dev/pkg/controller"
+ injection "knative.dev/pkg/injection"
+ logging "knative.dev/pkg/logging"
+)
+
+func init() {
+ injection.Default.RegisterInformer(withInformer)
+ injection.Dynamic.RegisterDynamicInformer(withDynamicInformer)
+}
+
+// Key is used for associating the Informer inside the context.Context.
+type Key struct{}
+
+func withInformer(ctx context.Context) (context.Context, controller.Informer) {
+ f := factory.Get(ctx)
+ inf := f.Tekton().V1().PipelineRuns()
+ return context.WithValue(ctx, Key{}, inf), inf.Informer()
+}
+
+func withDynamicInformer(ctx context.Context) context.Context {
+ inf := &wrapper{client: client.Get(ctx), resourceVersion: injection.GetResourceVersion(ctx)}
+ return context.WithValue(ctx, Key{}, inf)
+}
+
+// Get extracts the typed informer from the context.
+func Get(ctx context.Context) v1.PipelineRunInformer {
+ untyped := ctx.Value(Key{})
+ if untyped == nil {
+ logging.FromContext(ctx).Panic(
+ "Unable to fetch github.com/tektoncd/pipeline/pkg/client/informers/externalversions/pipeline/v1.PipelineRunInformer from context.")
+ }
+ return untyped.(v1.PipelineRunInformer)
+}
+
+type wrapper struct {
+ client versioned.Interface
+
+ namespace string
+
+ resourceVersion string
+}
+
+var _ v1.PipelineRunInformer = (*wrapper)(nil)
+var _ pipelinev1.PipelineRunLister = (*wrapper)(nil)
+
+func (w *wrapper) Informer() cache.SharedIndexInformer {
+ return cache.NewSharedIndexInformer(nil, &apispipelinev1.PipelineRun{}, 0, nil)
+}
+
+func (w *wrapper) Lister() pipelinev1.PipelineRunLister {
+ return w
+}
+
+func (w *wrapper) PipelineRuns(namespace string) pipelinev1.PipelineRunNamespaceLister {
+ return &wrapper{client: w.client, namespace: namespace, resourceVersion: w.resourceVersion}
+}
+
+// SetResourceVersion allows consumers to adjust the minimum resourceVersion
+// used by the underlying client. It is not accessible via the standard
+// lister interface, but can be accessed through a user-defined interface and
+// an implementation check e.g. rvs, ok := foo.(ResourceVersionSetter)
+func (w *wrapper) SetResourceVersion(resourceVersion string) {
+ w.resourceVersion = resourceVersion
+}
+
+func (w *wrapper) List(selector labels.Selector) (ret []*apispipelinev1.PipelineRun, err error) {
+ lo, err := w.client.TektonV1().PipelineRuns(w.namespace).List(context.TODO(), metav1.ListOptions{
+ LabelSelector: selector.String(),
+ ResourceVersion: w.resourceVersion,
+ })
+ if err != nil {
+ return nil, err
+ }
+ for idx := range lo.Items {
+ ret = append(ret, &lo.Items[idx])
+ }
+ return ret, nil
+}
+
+func (w *wrapper) Get(name string) (*apispipelinev1.PipelineRun, error) {
+ return w.client.TektonV1().PipelineRuns(w.namespace).Get(context.TODO(), name, metav1.GetOptions{
+ ResourceVersion: w.resourceVersion,
+ })
+}
diff --git a/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/controller.go b/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/controller.go
new file mode 100644
index 00000000000..51da1826e17
--- /dev/null
+++ b/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/controller.go
@@ -0,0 +1,162 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package pipelinerun
+
+import (
+ context "context"
+ fmt "fmt"
+ reflect "reflect"
+ strings "strings"
+
+ versionedscheme "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/scheme"
+ client "github.com/tektoncd/pipeline/pkg/client/injection/client"
+ pipelinerun "github.com/tektoncd/pipeline/pkg/client/injection/informers/pipeline/v1/pipelinerun"
+ zap "go.uber.org/zap"
+ corev1 "k8s.io/api/core/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ types "k8s.io/apimachinery/pkg/types"
+ watch "k8s.io/apimachinery/pkg/watch"
+ scheme "k8s.io/client-go/kubernetes/scheme"
+ v1 "k8s.io/client-go/kubernetes/typed/core/v1"
+ record "k8s.io/client-go/tools/record"
+ kubeclient "knative.dev/pkg/client/injection/kube/client"
+ controller "knative.dev/pkg/controller"
+ logging "knative.dev/pkg/logging"
+ logkey "knative.dev/pkg/logging/logkey"
+ reconciler "knative.dev/pkg/reconciler"
+)
+
+const (
+ defaultControllerAgentName = "pipelinerun-controller"
+ defaultFinalizerName = "pipelineruns.tekton.dev"
+)
+
+// NewImpl returns a controller.Impl that handles queuing and feeding work from
+// the queue through an implementation of controller.Reconciler, delegating to
+// the provided Interface and optional Finalizer methods. OptionsFn is used to return
+// controller.ControllerOptions to be used by the internal reconciler.
+func NewImpl(ctx context.Context, r Interface, optionsFns ...controller.OptionsFn) *controller.Impl {
+ logger := logging.FromContext(ctx)
+
+ // Check the options function input. It should be 0 or 1.
+ if len(optionsFns) > 1 {
+ logger.Fatal("Up to one options function is supported, found: ", len(optionsFns))
+ }
+
+ pipelinerunInformer := pipelinerun.Get(ctx)
+
+ lister := pipelinerunInformer.Lister()
+
+ var promoteFilterFunc func(obj interface{}) bool
+
+ rec := &reconcilerImpl{
+ LeaderAwareFuncs: reconciler.LeaderAwareFuncs{
+ PromoteFunc: func(bkt reconciler.Bucket, enq func(reconciler.Bucket, types.NamespacedName)) error {
+ all, err := lister.List(labels.Everything())
+ if err != nil {
+ return err
+ }
+ for _, elt := range all {
+ if promoteFilterFunc != nil {
+ if ok := promoteFilterFunc(elt); !ok {
+ continue
+ }
+ }
+ enq(bkt, types.NamespacedName{
+ Namespace: elt.GetNamespace(),
+ Name: elt.GetName(),
+ })
+ }
+ return nil
+ },
+ },
+ Client: client.Get(ctx),
+ Lister: lister,
+ reconciler: r,
+ finalizerName: defaultFinalizerName,
+ }
+
+ ctrType := reflect.TypeOf(r).Elem()
+ ctrTypeName := fmt.Sprintf("%s.%s", ctrType.PkgPath(), ctrType.Name())
+ ctrTypeName = strings.ReplaceAll(ctrTypeName, "/", ".")
+
+ logger = logger.With(
+ zap.String(logkey.ControllerType, ctrTypeName),
+ zap.String(logkey.Kind, "tekton.dev.PipelineRun"),
+ )
+
+ impl := controller.NewContext(ctx, rec, controller.ControllerOptions{WorkQueueName: ctrTypeName, Logger: logger})
+ agentName := defaultControllerAgentName
+
+ // Pass impl to the options. Save any optional results.
+ for _, fn := range optionsFns {
+ opts := fn(impl)
+ if opts.ConfigStore != nil {
+ rec.configStore = opts.ConfigStore
+ }
+ if opts.FinalizerName != "" {
+ rec.finalizerName = opts.FinalizerName
+ }
+ if opts.AgentName != "" {
+ agentName = opts.AgentName
+ }
+ if opts.SkipStatusUpdates {
+ rec.skipStatusUpdates = true
+ }
+ if opts.DemoteFunc != nil {
+ rec.DemoteFunc = opts.DemoteFunc
+ }
+ if opts.PromoteFilterFunc != nil {
+ promoteFilterFunc = opts.PromoteFilterFunc
+ }
+ }
+
+ rec.Recorder = createRecorder(ctx, agentName)
+
+ return impl
+}
+
+func createRecorder(ctx context.Context, agentName string) record.EventRecorder {
+ logger := logging.FromContext(ctx)
+
+ recorder := controller.GetEventRecorder(ctx)
+ if recorder == nil {
+ // Create event broadcaster
+ logger.Debug("Creating event broadcaster")
+ eventBroadcaster := record.NewBroadcaster()
+ watches := []watch.Interface{
+ eventBroadcaster.StartLogging(logger.Named("event-broadcaster").Infof),
+ eventBroadcaster.StartRecordingToSink(
+ &v1.EventSinkImpl{Interface: kubeclient.Get(ctx).CoreV1().Events("")}),
+ }
+ recorder = eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: agentName})
+ go func() {
+ <-ctx.Done()
+ for _, w := range watches {
+ w.Stop()
+ }
+ }()
+ }
+
+ return recorder
+}
+
+func init() {
+ versionedscheme.AddToScheme(scheme.Scheme)
+}
diff --git a/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/reconciler.go b/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/reconciler.go
new file mode 100644
index 00000000000..ccc3d698ada
--- /dev/null
+++ b/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/reconciler.go
@@ -0,0 +1,442 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package pipelinerun
+
+import (
+ context "context"
+ json "encoding/json"
+ fmt "fmt"
+
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ versioned "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
+ pipelinev1 "github.com/tektoncd/pipeline/pkg/client/listers/pipeline/v1"
+ zap "go.uber.org/zap"
+ corev1 "k8s.io/api/core/v1"
+ equality "k8s.io/apimachinery/pkg/api/equality"
+ errors "k8s.io/apimachinery/pkg/api/errors"
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ labels "k8s.io/apimachinery/pkg/labels"
+ types "k8s.io/apimachinery/pkg/types"
+ sets "k8s.io/apimachinery/pkg/util/sets"
+ record "k8s.io/client-go/tools/record"
+ controller "knative.dev/pkg/controller"
+ kmp "knative.dev/pkg/kmp"
+ logging "knative.dev/pkg/logging"
+ reconciler "knative.dev/pkg/reconciler"
+)
+
+// Interface defines the strongly typed interfaces to be implemented by a
+// controller reconciling v1.PipelineRun.
+type Interface interface {
+ // ReconcileKind implements custom logic to reconcile v1.PipelineRun. Any changes
+ // to the objects .Status or .Finalizers will be propagated to the stored
+ // object. It is recommended that implementors do not call any update calls
+ // for the Kind inside of ReconcileKind, it is the responsibility of the calling
+ // controller to propagate those properties. The resource passed to ReconcileKind
+ // will always have an empty deletion timestamp.
+ ReconcileKind(ctx context.Context, o *v1.PipelineRun) reconciler.Event
+}
+
+// Finalizer defines the strongly typed interfaces to be implemented by a
+// controller finalizing v1.PipelineRun.
+type Finalizer interface {
+ // FinalizeKind implements custom logic to finalize v1.PipelineRun. Any changes
+ // to the objects .Status or .Finalizers will be ignored. Returning a nil or
+ // Normal type reconciler.Event will allow the finalizer to be deleted on
+ // the resource. The resource passed to FinalizeKind will always have a set
+ // deletion timestamp.
+ FinalizeKind(ctx context.Context, o *v1.PipelineRun) reconciler.Event
+}
+
+// ReadOnlyInterface defines the strongly typed interfaces to be implemented by a
+// controller reconciling v1.PipelineRun if they want to process resources for which
+// they are not the leader.
+type ReadOnlyInterface interface {
+ // ObserveKind implements logic to observe v1.PipelineRun.
+ // This method should not write to the API.
+ ObserveKind(ctx context.Context, o *v1.PipelineRun) reconciler.Event
+}
+
+type doReconcile func(ctx context.Context, o *v1.PipelineRun) reconciler.Event
+
+// reconcilerImpl implements controller.Reconciler for v1.PipelineRun resources.
+type reconcilerImpl struct {
+ // LeaderAwareFuncs is inlined to help us implement reconciler.LeaderAware.
+ reconciler.LeaderAwareFuncs
+
+ // Client is used to write back status updates.
+ Client versioned.Interface
+
+ // Listers index properties about resources.
+ Lister pipelinev1.PipelineRunLister
+
+ // Recorder is an event recorder for recording Event resources to the
+ // Kubernetes API.
+ Recorder record.EventRecorder
+
+ // configStore allows for decorating a context with config maps.
+ // +optional
+ configStore reconciler.ConfigStore
+
+ // reconciler is the implementation of the business logic of the resource.
+ reconciler Interface
+
+ // finalizerName is the name of the finalizer to reconcile.
+ finalizerName string
+
+ // skipStatusUpdates configures whether or not this reconciler automatically updates
+ // the status of the reconciled resource.
+ skipStatusUpdates bool
+}
+
+// Check that our Reconciler implements controller.Reconciler.
+var _ controller.Reconciler = (*reconcilerImpl)(nil)
+
+// Check that our generated Reconciler is always LeaderAware.
+var _ reconciler.LeaderAware = (*reconcilerImpl)(nil)
+
+func NewReconciler(ctx context.Context, logger *zap.SugaredLogger, client versioned.Interface, lister pipelinev1.PipelineRunLister, recorder record.EventRecorder, r Interface, options ...controller.Options) controller.Reconciler {
+ // Check the options function input. It should be 0 or 1.
+ if len(options) > 1 {
+ logger.Fatal("Up to one options struct is supported, found: ", len(options))
+ }
+
+ // Fail fast when users inadvertently implement the other LeaderAware interface.
+ // For the typed reconcilers, Promote shouldn't take any arguments.
+ if _, ok := r.(reconciler.LeaderAware); ok {
+ logger.Fatalf("%T implements the incorrect LeaderAware interface. Promote() should not take an argument as genreconciler handles the enqueuing automatically.", r)
+ }
+
+ rec := &reconcilerImpl{
+ LeaderAwareFuncs: reconciler.LeaderAwareFuncs{
+ PromoteFunc: func(bkt reconciler.Bucket, enq func(reconciler.Bucket, types.NamespacedName)) error {
+ all, err := lister.List(labels.Everything())
+ if err != nil {
+ return err
+ }
+ for _, elt := range all {
+ // TODO: Consider letting users specify a filter in options.
+ enq(bkt, types.NamespacedName{
+ Namespace: elt.GetNamespace(),
+ Name: elt.GetName(),
+ })
+ }
+ return nil
+ },
+ },
+ Client: client,
+ Lister: lister,
+ Recorder: recorder,
+ reconciler: r,
+ finalizerName: defaultFinalizerName,
+ }
+
+ for _, opts := range options {
+ if opts.ConfigStore != nil {
+ rec.configStore = opts.ConfigStore
+ }
+ if opts.FinalizerName != "" {
+ rec.finalizerName = opts.FinalizerName
+ }
+ if opts.SkipStatusUpdates {
+ rec.skipStatusUpdates = true
+ }
+ if opts.DemoteFunc != nil {
+ rec.DemoteFunc = opts.DemoteFunc
+ }
+ }
+
+ return rec
+}
+
+// Reconcile implements controller.Reconciler
+func (r *reconcilerImpl) Reconcile(ctx context.Context, key string) error {
+ logger := logging.FromContext(ctx)
+
+ // Initialize the reconciler state. This will convert the namespace/name
+ // string into a distinct namespace and name, determine if this instance of
+ // the reconciler is the leader, and any additional interfaces implemented
+ // by the reconciler. Returns an error is the resource key is invalid.
+ s, err := newState(key, r)
+ if err != nil {
+ logger.Error("Invalid resource key: ", key)
+ return nil
+ }
+
+ // If we are not the leader, and we don't implement either ReadOnly
+ // observer interfaces, then take a fast-path out.
+ if s.isNotLeaderNorObserver() {
+ return controller.NewSkipKey(key)
+ }
+
+ // If configStore is set, attach the frozen configuration to the context.
+ if r.configStore != nil {
+ ctx = r.configStore.ToContext(ctx)
+ }
+
+ // Add the recorder to context.
+ ctx = controller.WithEventRecorder(ctx, r.Recorder)
+
+ // Get the resource with this namespace/name.
+
+ getter := r.Lister.PipelineRuns(s.namespace)
+
+ original, err := getter.Get(s.name)
+
+ if errors.IsNotFound(err) {
+ // The resource may no longer exist, in which case we stop processing and call
+ // the ObserveDeletion handler if appropriate.
+ logger.Debugf("Resource %q no longer exists", key)
+ if del, ok := r.reconciler.(reconciler.OnDeletionInterface); ok {
+ return del.ObserveDeletion(ctx, types.NamespacedName{
+ Namespace: s.namespace,
+ Name: s.name,
+ })
+ }
+ return nil
+ } else if err != nil {
+ return err
+ }
+
+ // Don't modify the informers copy.
+ resource := original.DeepCopy()
+
+ var reconcileEvent reconciler.Event
+
+ name, do := s.reconcileMethodFor(resource)
+ // Append the target method to the logger.
+ logger = logger.With(zap.String("targetMethod", name))
+ switch name {
+ case reconciler.DoReconcileKind:
+ // Set and update the finalizer on resource if r.reconciler
+ // implements Finalizer.
+ if resource, err = r.setFinalizerIfFinalizer(ctx, resource); err != nil {
+ return fmt.Errorf("failed to set finalizers: %w", err)
+ }
+
+ // Reconcile this copy of the resource and then write back any status
+ // updates regardless of whether the reconciliation errored out.
+ reconcileEvent = do(ctx, resource)
+
+ case reconciler.DoFinalizeKind:
+ // For finalizing reconcilers, if this resource being marked for deletion
+ // and reconciled cleanly (nil or normal event), remove the finalizer.
+ reconcileEvent = do(ctx, resource)
+
+ if resource, err = r.clearFinalizer(ctx, resource, reconcileEvent); err != nil {
+ return fmt.Errorf("failed to clear finalizers: %w", err)
+ }
+
+ case reconciler.DoObserveKind:
+ // Observe any changes to this resource, since we are not the leader.
+ reconcileEvent = do(ctx, resource)
+
+ }
+
+ // Synchronize the status.
+ switch {
+ case r.skipStatusUpdates:
+ // This reconciler implementation is configured to skip resource updates.
+ // This may mean this reconciler does not observe spec, but reconciles external changes.
+ case equality.Semantic.DeepEqual(original.Status, resource.Status):
+ // If we didn't change anything then don't call updateStatus.
+ // This is important because the copy we loaded from the injectionInformer's
+ // cache may be stale and we don't want to overwrite a prior update
+ // to status with this stale state.
+ case !s.isLeader:
+ // High-availability reconcilers may have many replicas watching the resource, but only
+ // the elected leader is expected to write modifications.
+ logger.Warn("Saw status changes when we aren't the leader!")
+ default:
+ if err = r.updateStatus(ctx, original, resource); err != nil {
+ logger.Warnw("Failed to update resource status", zap.Error(err))
+ r.Recorder.Eventf(resource, corev1.EventTypeWarning, "UpdateFailed",
+ "Failed to update status for %q: %v", resource.Name, err)
+ return err
+ }
+ }
+
+ // Report the reconciler event, if any.
+ if reconcileEvent != nil {
+ var event *reconciler.ReconcilerEvent
+ if reconciler.EventAs(reconcileEvent, &event) {
+ logger.Infow("Returned an event", zap.Any("event", reconcileEvent))
+ r.Recorder.Event(resource, event.EventType, event.Reason, event.Error())
+
+ // the event was wrapped inside an error, consider the reconciliation as failed
+ if _, isEvent := reconcileEvent.(*reconciler.ReconcilerEvent); !isEvent {
+ return reconcileEvent
+ }
+ return nil
+ }
+
+ if controller.IsSkipKey(reconcileEvent) {
+ // This is a wrapped error, don't emit an event.
+ } else if ok, _ := controller.IsRequeueKey(reconcileEvent); ok {
+ // This is a wrapped error, don't emit an event.
+ } else {
+ logger.Errorw("Returned an error", zap.Error(reconcileEvent))
+ r.Recorder.Event(resource, corev1.EventTypeWarning, "InternalError", reconcileEvent.Error())
+ }
+ return reconcileEvent
+ }
+
+ return nil
+}
+
+func (r *reconcilerImpl) updateStatus(ctx context.Context, existing *v1.PipelineRun, desired *v1.PipelineRun) error {
+ existing = existing.DeepCopy()
+ return reconciler.RetryUpdateConflicts(func(attempts int) (err error) {
+ // The first iteration tries to use the injectionInformer's state, subsequent attempts fetch the latest state via API.
+ if attempts > 0 {
+
+ getter := r.Client.TektonV1().PipelineRuns(desired.Namespace)
+
+ existing, err = getter.Get(ctx, desired.Name, metav1.GetOptions{})
+ if err != nil {
+ return err
+ }
+ }
+
+ // If there's nothing to update, just return.
+ if equality.Semantic.DeepEqual(existing.Status, desired.Status) {
+ return nil
+ }
+
+ if diff, err := kmp.SafeDiff(existing.Status, desired.Status); err == nil && diff != "" {
+ logging.FromContext(ctx).Debug("Updating status with: ", diff)
+ }
+
+ existing.Status = desired.Status
+
+ updater := r.Client.TektonV1().PipelineRuns(existing.Namespace)
+
+ _, err = updater.UpdateStatus(ctx, existing, metav1.UpdateOptions{})
+ return err
+ })
+}
+
+// updateFinalizersFiltered will update the Finalizers of the resource.
+// TODO: this method could be generic and sync all finalizers. For now it only
+// updates defaultFinalizerName or its override.
+func (r *reconcilerImpl) updateFinalizersFiltered(ctx context.Context, resource *v1.PipelineRun) (*v1.PipelineRun, error) {
+
+ getter := r.Lister.PipelineRuns(resource.Namespace)
+
+ actual, err := getter.Get(resource.Name)
+ if err != nil {
+ return resource, err
+ }
+
+ // Don't modify the informers copy.
+ existing := actual.DeepCopy()
+
+ var finalizers []string
+
+ // If there's nothing to update, just return.
+ existingFinalizers := sets.NewString(existing.Finalizers...)
+ desiredFinalizers := sets.NewString(resource.Finalizers...)
+
+ if desiredFinalizers.Has(r.finalizerName) {
+ if existingFinalizers.Has(r.finalizerName) {
+ // Nothing to do.
+ return resource, nil
+ }
+ // Add the finalizer.
+ finalizers = append(existing.Finalizers, r.finalizerName)
+ } else {
+ if !existingFinalizers.Has(r.finalizerName) {
+ // Nothing to do.
+ return resource, nil
+ }
+ // Remove the finalizer.
+ existingFinalizers.Delete(r.finalizerName)
+ finalizers = existingFinalizers.List()
+ }
+
+ mergePatch := map[string]interface{}{
+ "metadata": map[string]interface{}{
+ "finalizers": finalizers,
+ "resourceVersion": existing.ResourceVersion,
+ },
+ }
+
+ patch, err := json.Marshal(mergePatch)
+ if err != nil {
+ return resource, err
+ }
+
+ patcher := r.Client.TektonV1().PipelineRuns(resource.Namespace)
+
+ resourceName := resource.Name
+ updated, err := patcher.Patch(ctx, resourceName, types.MergePatchType, patch, metav1.PatchOptions{})
+ if err != nil {
+ r.Recorder.Eventf(existing, corev1.EventTypeWarning, "FinalizerUpdateFailed",
+ "Failed to update finalizers for %q: %v", resourceName, err)
+ } else {
+ r.Recorder.Eventf(updated, corev1.EventTypeNormal, "FinalizerUpdate",
+ "Updated %q finalizers", resource.GetName())
+ }
+ return updated, err
+}
+
+func (r *reconcilerImpl) setFinalizerIfFinalizer(ctx context.Context, resource *v1.PipelineRun) (*v1.PipelineRun, error) {
+ if _, ok := r.reconciler.(Finalizer); !ok {
+ return resource, nil
+ }
+
+ finalizers := sets.NewString(resource.Finalizers...)
+
+ // If this resource is not being deleted, mark the finalizer.
+ if resource.GetDeletionTimestamp().IsZero() {
+ finalizers.Insert(r.finalizerName)
+ }
+
+ resource.Finalizers = finalizers.List()
+
+ // Synchronize the finalizers filtered by r.finalizerName.
+ return r.updateFinalizersFiltered(ctx, resource)
+}
+
+func (r *reconcilerImpl) clearFinalizer(ctx context.Context, resource *v1.PipelineRun, reconcileEvent reconciler.Event) (*v1.PipelineRun, error) {
+ if _, ok := r.reconciler.(Finalizer); !ok {
+ return resource, nil
+ }
+ if resource.GetDeletionTimestamp().IsZero() {
+ return resource, nil
+ }
+
+ finalizers := sets.NewString(resource.Finalizers...)
+
+ if reconcileEvent != nil {
+ var event *reconciler.ReconcilerEvent
+ if reconciler.EventAs(reconcileEvent, &event) {
+ if event.EventType == corev1.EventTypeNormal {
+ finalizers.Delete(r.finalizerName)
+ }
+ }
+ } else {
+ finalizers.Delete(r.finalizerName)
+ }
+
+ resource.Finalizers = finalizers.List()
+
+ // Synchronize the finalizers filtered by r.finalizerName.
+ return r.updateFinalizersFiltered(ctx, resource)
+}
diff --git a/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/state.go b/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/state.go
new file mode 100644
index 00000000000..35540fcf4e9
--- /dev/null
+++ b/pkg/client/injection/reconciler/pipeline/v1/pipelinerun/state.go
@@ -0,0 +1,97 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by injection-gen. DO NOT EDIT.
+
+package pipelinerun
+
+import (
+ fmt "fmt"
+
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ types "k8s.io/apimachinery/pkg/types"
+ cache "k8s.io/client-go/tools/cache"
+ reconciler "knative.dev/pkg/reconciler"
+)
+
+// state is used to track the state of a reconciler in a single run.
+type state struct {
+ // key is the original reconciliation key from the queue.
+ key string
+ // namespace is the namespace split from the reconciliation key.
+ namespace string
+ // name is the name split from the reconciliation key.
+ name string
+ // reconciler is the reconciler.
+ reconciler Interface
+ // roi is the read only interface cast of the reconciler.
+ roi ReadOnlyInterface
+ // isROI (Read Only Interface) the reconciler only observes reconciliation.
+ isROI bool
+ // isLeader the instance of the reconciler is the elected leader.
+ isLeader bool
+}
+
+func newState(key string, r *reconcilerImpl) (*state, error) {
+ // Convert the namespace/name string into a distinct namespace and name.
+ namespace, name, err := cache.SplitMetaNamespaceKey(key)
+ if err != nil {
+ return nil, fmt.Errorf("invalid resource key: %s", key)
+ }
+
+ roi, isROI := r.reconciler.(ReadOnlyInterface)
+
+ isLeader := r.IsLeaderFor(types.NamespacedName{
+ Namespace: namespace,
+ Name: name,
+ })
+
+ return &state{
+ key: key,
+ namespace: namespace,
+ name: name,
+ reconciler: r.reconciler,
+ roi: roi,
+ isROI: isROI,
+ isLeader: isLeader,
+ }, nil
+}
+
+// isNotLeaderNorObserver checks to see if this reconciler with the current
+// state is enabled to do any work or not.
+// isNotLeaderNorObserver returns true when there is no work possible for the
+// reconciler.
+func (s *state) isNotLeaderNorObserver() bool {
+ if !s.isLeader && !s.isROI {
+ // If we are not the leader, and we don't implement the ReadOnly
+ // interface, then take a fast-path out.
+ return true
+ }
+ return false
+}
+
+func (s *state) reconcileMethodFor(o *v1.PipelineRun) (string, doReconcile) {
+ if o.GetDeletionTimestamp().IsZero() {
+ if s.isLeader {
+ return reconciler.DoReconcileKind, s.reconciler.ReconcileKind
+ } else if s.isROI {
+ return reconciler.DoObserveKind, s.roi.ObserveKind
+ }
+ } else if fin, ok := s.reconciler.(Finalizer); s.isLeader && ok {
+ return reconciler.DoFinalizeKind, fin.FinalizeKind
+ }
+ return "unknown", nil
+}
diff --git a/pkg/client/listers/pipeline/v1/expansion_generated.go b/pkg/client/listers/pipeline/v1/expansion_generated.go
index bf40b83e796..93a3b875675 100644
--- a/pkg/client/listers/pipeline/v1/expansion_generated.go
+++ b/pkg/client/listers/pipeline/v1/expansion_generated.go
@@ -26,6 +26,14 @@ type PipelineListerExpansion interface{}
// PipelineNamespaceLister.
type PipelineNamespaceListerExpansion interface{}
+// PipelineRunListerExpansion allows custom methods to be added to
+// PipelineRunLister.
+type PipelineRunListerExpansion interface{}
+
+// PipelineRunNamespaceListerExpansion allows custom methods to be added to
+// PipelineRunNamespaceLister.
+type PipelineRunNamespaceListerExpansion interface{}
+
// TaskListerExpansion allows custom methods to be added to
// TaskLister.
type TaskListerExpansion interface{}
diff --git a/pkg/client/listers/pipeline/v1/pipelinerun.go b/pkg/client/listers/pipeline/v1/pipelinerun.go
new file mode 100644
index 00000000000..4a16673da05
--- /dev/null
+++ b/pkg/client/listers/pipeline/v1/pipelinerun.go
@@ -0,0 +1,99 @@
+/*
+Copyright 2020 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.
+*/
+
+// Code generated by lister-gen. DO NOT EDIT.
+
+package v1
+
+import (
+ v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
+ "k8s.io/apimachinery/pkg/api/errors"
+ "k8s.io/apimachinery/pkg/labels"
+ "k8s.io/client-go/tools/cache"
+)
+
+// PipelineRunLister helps list PipelineRuns.
+// All objects returned here must be treated as read-only.
+type PipelineRunLister interface {
+ // List lists all PipelineRuns in the indexer.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1.PipelineRun, err error)
+ // PipelineRuns returns an object that can list and get PipelineRuns.
+ PipelineRuns(namespace string) PipelineRunNamespaceLister
+ PipelineRunListerExpansion
+}
+
+// pipelineRunLister implements the PipelineRunLister interface.
+type pipelineRunLister struct {
+ indexer cache.Indexer
+}
+
+// NewPipelineRunLister returns a new PipelineRunLister.
+func NewPipelineRunLister(indexer cache.Indexer) PipelineRunLister {
+ return &pipelineRunLister{indexer: indexer}
+}
+
+// List lists all PipelineRuns in the indexer.
+func (s *pipelineRunLister) List(selector labels.Selector) (ret []*v1.PipelineRun, err error) {
+ err = cache.ListAll(s.indexer, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1.PipelineRun))
+ })
+ return ret, err
+}
+
+// PipelineRuns returns an object that can list and get PipelineRuns.
+func (s *pipelineRunLister) PipelineRuns(namespace string) PipelineRunNamespaceLister {
+ return pipelineRunNamespaceLister{indexer: s.indexer, namespace: namespace}
+}
+
+// PipelineRunNamespaceLister helps list and get PipelineRuns.
+// All objects returned here must be treated as read-only.
+type PipelineRunNamespaceLister interface {
+ // List lists all PipelineRuns in the indexer for a given namespace.
+ // Objects returned here must be treated as read-only.
+ List(selector labels.Selector) (ret []*v1.PipelineRun, err error)
+ // Get retrieves the PipelineRun from the indexer for a given namespace and name.
+ // Objects returned here must be treated as read-only.
+ Get(name string) (*v1.PipelineRun, error)
+ PipelineRunNamespaceListerExpansion
+}
+
+// pipelineRunNamespaceLister implements the PipelineRunNamespaceLister
+// interface.
+type pipelineRunNamespaceLister struct {
+ indexer cache.Indexer
+ namespace string
+}
+
+// List lists all PipelineRuns in the indexer for a given namespace.
+func (s pipelineRunNamespaceLister) List(selector labels.Selector) (ret []*v1.PipelineRun, err error) {
+ err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
+ ret = append(ret, m.(*v1.PipelineRun))
+ })
+ return ret, err
+}
+
+// Get retrieves the PipelineRun from the indexer for a given namespace and name.
+func (s pipelineRunNamespaceLister) Get(name string) (*v1.PipelineRun, error) {
+ obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
+ if err != nil {
+ return nil, err
+ }
+ if !exists {
+ return nil, errors.NewNotFound(v1.Resource("pipelinerun"), name)
+ }
+ return obj.(*v1.PipelineRun), nil
+}
diff --git a/third_party/github.com/hashicorp/errwrap/errwrap.go b/third_party/github.com/hashicorp/errwrap/errwrap.go
index a733bef18c0..44e368e5692 100644
--- a/third_party/github.com/hashicorp/errwrap/errwrap.go
+++ b/third_party/github.com/hashicorp/errwrap/errwrap.go
@@ -44,6 +44,8 @@ func Wrap(outer, inner error) error {
//
// format is the format of the error message. The string '{{err}}' will
// be replaced with the original error message.
+//
+// Deprecated: Use fmt.Errorf()
func Wrapf(format string, err error) error {
outerMsg := "
"
if err != nil {
@@ -148,6 +150,9 @@ func Walk(err error, cb WalkFunc) {
for _, err := range e.WrappedErrors() {
Walk(err, cb)
}
+ case interface{ Unwrap() error }:
+ cb(err)
+ Walk(e.Unwrap(), cb)
default:
cb(err)
}
@@ -167,3 +172,7 @@ func (w *wrappedError) Error() string {
func (w *wrappedError) WrappedErrors() []error {
return []error{w.Outer, w.Inner}
}
+
+func (w *wrappedError) Unwrap() error {
+ return w.Inner
+}