Documentation ¶
Index ¶
- Constants
- func ApplyContexts(spec *v1beta1.PipelineSpec, pipelineName string, pr *v1beta1.PipelineRun) *v1beta1.PipelineSpec
- func ApplyParameters(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) *v1beta1.PipelineSpec
- func ApplyPipelineTaskContexts(pt *v1beta1.PipelineTask) *v1beta1.PipelineTask
- func ApplyPipelineTaskStateContext(state PipelineRunState, replacements map[string]string)
- func ApplyReplacements(p *v1beta1.PipelineSpec, replacements map[string]string, ...) *v1beta1.PipelineSpec
- func ApplyTaskResults(targets PipelineRunState, resolvedResultRefs ResolvedResultRefs)
- func ApplyTaskResultsToPipelineResults(results []v1beta1.PipelineResult, ...) []v1beta1.PipelineRunResult
- func ApplyWorkspaces(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) *v1beta1.PipelineSpec
- func GetInputSteps(inputs map[string]*resourcev1alpha1.PipelineResource, ...) []v1beta1.TaskResourceBinding
- func GetOutputSteps(outputs map[string]*resourcev1alpha1.PipelineResource, ...) []v1beta1.TaskResourceBinding
- func GetPipelineData(ctx context.Context, pipelineRun *v1beta1.PipelineRun, getPipeline GetPipeline) (*metav1.ObjectMeta, *v1beta1.PipelineSpec, error)
- func GetResourcesFromBindings(pr *v1beta1.PipelineRun, getResource resources.GetResource) (map[string]*resourcev1alpha1.PipelineResource, error)
- func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus, ...) string
- func ValidateOptionalWorkspaces(pipelineWorkspaces []v1beta1.PipelineWorkspaceDeclaration, ...) error
- func ValidateParamTypesMatching(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
- func ValidatePipelineResults(ps *v1beta1.PipelineSpec, state PipelineRunState) error
- func ValidatePipelineTaskResults(state PipelineRunState) error
- func ValidateRequiredParametersProvided(pipelineParameters *[]v1beta1.ParamSpec, ...) error
- func ValidateResourceBindings(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
- func ValidateServiceaccountMapping(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
- func ValidateTaskRunSpecs(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
- func ValidateWorkspaceBindings(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
- func WrapSteps(tr *v1beta1.TaskRunSpec, pt *v1beta1.PipelineTask, ...)
- type ConditionNotFoundError
- type GetCondition
- type GetPipeline
- type GetRun
- type LocalPipelineRefResolver
- type PipelineRunFacts
- func (facts *PipelineRunFacts) DAGExecutionQueue() (PipelineRunState, error)
- func (facts *PipelineRunFacts) GetFinalTasks() PipelineRunState
- func (facts *PipelineRunFacts) GetPipelineConditionStatus(pr *v1beta1.PipelineRun, logger *zap.SugaredLogger) *apis.Condition
- func (facts *PipelineRunFacts) GetPipelineTaskStatus() map[string]string
- func (facts *PipelineRunFacts) GetSkippedTasks() []v1beta1.SkippedTask
- func (facts *PipelineRunFacts) IsGracefullyCancelled() bool
- func (facts *PipelineRunFacts) IsGracefullyStopped() bool
- func (facts *PipelineRunFacts) IsRunning() bool
- func (facts *PipelineRunFacts) IsStopping() bool
- func (facts *PipelineRunFacts) ResetSkippedCache()
- type PipelineRunState
- func (state PipelineRunState) AdjustStartTime(unadjustedStartTime *metav1.Time) *metav1.Time
- func (state PipelineRunState) GetRunsStatus(pr *v1beta1.PipelineRun) map[string]*v1beta1.PipelineRunRunStatus
- func (state PipelineRunState) GetTaskRunsStatus(pr *v1beta1.PipelineRun) map[string]*v1beta1.PipelineRunTaskRunStatus
- func (state PipelineRunState) IsBeforeFirstTaskRun() bool
- func (state PipelineRunState) ToMap() map[string]*ResolvedPipelineRunTask
- type ResolvedConditionCheck
- type ResolvedPipelineRunTask
- func (t ResolvedPipelineRunTask) IsCancelled() bool
- func (t ResolvedPipelineRunTask) IsConditionStatusFalse() bool
- func (t ResolvedPipelineRunTask) IsCustomTask() bool
- func (t ResolvedPipelineRunTask) IsDone(facts *PipelineRunFacts) bool
- func (t ResolvedPipelineRunTask) IsFailure() bool
- func (t *ResolvedPipelineRunTask) IsFinalTask(facts *PipelineRunFacts) bool
- func (t *ResolvedPipelineRunTask) IsFinallySkipped(facts *PipelineRunFacts) TaskSkipStatus
- func (t ResolvedPipelineRunTask) IsRunning() bool
- func (t ResolvedPipelineRunTask) IsStarted() bool
- func (t ResolvedPipelineRunTask) IsSuccessful() bool
- func (t *ResolvedPipelineRunTask) Skip(facts *PipelineRunFacts) TaskSkipStatus
- type ResolvedResultRef
- type ResolvedResultRefs
- type SkippingReason
- type TaskConditionCheckState
- type TaskNotFoundError
- type TaskSkipStatus
Constants ¶
const ( // PipelineTaskStateNone indicates that the execution status of a pipelineTask is unknown PipelineTaskStateNone = "None" // PipelineTaskStatusPrefix is a prefix of the param representing execution state of pipelineTask PipelineTaskStatusPrefix = "tasks." // PipelineTaskStatusSuffix is a suffix of the param representing execution state of pipelineTask PipelineTaskStatusSuffix = ".status" )
const ( // ReasonConditionCheckFailed indicates that the reason for the failure status is that the // condition check associated to the pipeline task evaluated to false ReasonConditionCheckFailed = "ConditionCheckFailed" )
Variables ¶
This section is empty.
Functions ¶
func ApplyContexts ¶ added in v0.14.0
func ApplyContexts(spec *v1beta1.PipelineSpec, pipelineName string, pr *v1beta1.PipelineRun) *v1beta1.PipelineSpec
ApplyContexts applies the substitution from $(context.(pipelineRun|pipeline).*) with the specified values. Currently supports only name substitution. Uses "" as a default if name is not specified.
func ApplyParameters ¶
func ApplyParameters(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) *v1beta1.PipelineSpec
ApplyParameters applies the params from a PipelineRun.Params to a PipelineSpec.
func ApplyPipelineTaskContexts ¶ added in v0.25.0
func ApplyPipelineTaskContexts(pt *v1beta1.PipelineTask) *v1beta1.PipelineTask
ApplyPipelineTaskContexts applies the substitution from $(context.pipelineTask.*) with the specified values. Uses "0" as a default if a value is not available.
func ApplyPipelineTaskStateContext ¶ added in v0.25.0
func ApplyPipelineTaskStateContext(state PipelineRunState, replacements map[string]string)
ApplyPipelineTaskStateContext replaces context variables referring to execution status with the specified status
func ApplyReplacements ¶
func ApplyReplacements(p *v1beta1.PipelineSpec, replacements map[string]string, arrayReplacements map[string][]string) *v1beta1.PipelineSpec
ApplyReplacements replaces placeholders for declared parameters with the specified replacements.
func ApplyTaskResults ¶ added in v0.11.0
func ApplyTaskResults(targets PipelineRunState, resolvedResultRefs ResolvedResultRefs)
ApplyTaskResults applies the ResolvedResultRef to each PipelineTask.Params and Pipeline.WhenExpressions in targets
func ApplyTaskResultsToPipelineResults ¶ added in v0.20.0
func ApplyTaskResultsToPipelineResults( results []v1beta1.PipelineResult, taskRunStatuses map[string]*v1beta1.PipelineRunTaskRunStatus, runStatuses map[string]*v1beta1.PipelineRunRunStatus) []v1beta1.PipelineRunResult
ApplyTaskResultsToPipelineResults applies the results of completed TasksRuns and Runs to a Pipeline's list of PipelineResults, returning the computed set of PipelineRunResults. References to non-existent TaskResults or failed TaskRuns or Runs result in a PipelineResult being considered invalid and omitted from the returned slice. A nil slice is returned if no results are passed in or all results are invalid.
func ApplyWorkspaces ¶ added in v0.17.0
func ApplyWorkspaces(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) *v1beta1.PipelineSpec
ApplyWorkspaces replaces workspace variables in the given pipeline spec with their concrete values.
func GetInputSteps ¶
func GetInputSteps(inputs map[string]*resourcev1alpha1.PipelineResource, inputResources []v1beta1.PipelineTaskInputResource, storageBasePath string) []v1beta1.TaskResourceBinding
GetInputSteps will add the correct `path` to the input resources for pt. If the resources are provided by a previous task, the correct `path` will be used so that the resource provided by that task will be used.
func GetOutputSteps ¶
func GetOutputSteps(outputs map[string]*resourcev1alpha1.PipelineResource, taskName, storageBasePath string) []v1beta1.TaskResourceBinding
GetOutputSteps will add the correct `path` to the output resources for pt
func GetPipelineData ¶ added in v0.8.0
func GetPipelineData(ctx context.Context, pipelineRun *v1beta1.PipelineRun, getPipeline GetPipeline) (*metav1.ObjectMeta, *v1beta1.PipelineSpec, error)
GetPipelineData will retrieve the Pipeline metadata and Spec associated with the provided PipelineRun. This can come from a reference Pipeline or from the PipelineRun's metadata and embedded PipelineSpec.
func GetResourcesFromBindings ¶
func GetResourcesFromBindings(pr *v1beta1.PipelineRun, getResource resources.GetResource) (map[string]*resourcev1alpha1.PipelineResource, error)
GetResourcesFromBindings will retrieve all Resources bound in PipelineRun pr and return a map from the declared name of the PipelineResource (which is how the PipelineResource will be referred to in the PipelineRun) to the PipelineResource, obtained via getResource.
func GetTaskRunName ¶ added in v0.13.0
func GetTaskRunName(taskRunsStatus map[string]*v1beta1.PipelineRunTaskRunStatus, ptName, prName string) string
GetTaskRunName should return a unique name for a `TaskRun` if one has not already been defined, and the existing one otherwise.
func ValidateOptionalWorkspaces ¶ added in v0.21.0
func ValidateOptionalWorkspaces(pipelineWorkspaces []v1beta1.PipelineWorkspaceDeclaration, state PipelineRunState) error
ValidateOptionalWorkspaces validates that any workspaces in the Pipeline that are marked as optional are also marked optional in the Tasks that receive them. This prevents a situation where a Task requires a workspace but a Pipeline does not offer the same guarantee the workspace will be provided at runtime.
func ValidateParamTypesMatching ¶
func ValidateParamTypesMatching(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
ValidateParamTypesMatching validate that parameters in PipelineRun override corresponding parameters in Pipeline of the same type.
func ValidatePipelineResults ¶ added in v0.21.0
func ValidatePipelineResults(ps *v1beta1.PipelineSpec, state PipelineRunState) error
ValidatePipelineResults ensures that any result references used by PipelineResults resolve to valid results. This prevents a situation where a PipelineResult references a result in a PipelineTask that doesn't exist or where the user has either misspelled a result name or the referenced task just doesn't return a result with that name.
func ValidatePipelineTaskResults ¶ added in v0.21.0
func ValidatePipelineTaskResults(state PipelineRunState) error
ValidatePipelineTaskResults ensures that any result references used by pipeline tasks resolve to valid results. This prevents a situation where a PipelineTask references a result in another PipelineTask that doesn't exist or where the user has either misspelled a result name or the referenced task just doesn't return a result with that name.
func ValidateRequiredParametersProvided ¶ added in v0.14.0
func ValidateRequiredParametersProvided(pipelineParameters *[]v1beta1.ParamSpec, pipelineRunParameters *[]v1beta1.Param) error
ValidateRequiredParametersProvided validates that all the parameters expected by the Pipeline are provided by the PipelineRun. Extra Parameters are allowed, the Pipeline will use the Parameters it needs and ignore the other Parameters.
func ValidateResourceBindings ¶ added in v0.8.0
func ValidateResourceBindings(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
ValidateResourceBindings validate that the PipelineResources declared in Pipeline p are bound in PipelineRun.
func ValidateServiceaccountMapping ¶ added in v0.13.0
func ValidateServiceaccountMapping(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
ValidateServiceaccountMapping validates that the ServiceAccountNames defined by a PipelineRun are not correct.
func ValidateTaskRunSpecs ¶ added in v0.16.0
func ValidateTaskRunSpecs(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
ValidateTaskRunSpecs that the TaskRunSpecs defined by a PipelineRun are correct.
func ValidateWorkspaceBindings ¶ added in v0.10.0
func ValidateWorkspaceBindings(p *v1beta1.PipelineSpec, pr *v1beta1.PipelineRun) error
ValidateWorkspaceBindings validates that the Workspaces expected by a Pipeline are provided by a PipelineRun.
func WrapSteps ¶
func WrapSteps(tr *v1beta1.TaskRunSpec, pt *v1beta1.PipelineTask, inputs, outputs map[string]*resourcev1alpha1.PipelineResource, storageBasePath string)
WrapSteps will add the correct `paths` to all of the inputs and outputs for pt
Types ¶
type ConditionNotFoundError ¶
ConditionNotFoundError is used to track failures to the
func (*ConditionNotFoundError) Error ¶
func (e *ConditionNotFoundError) Error() string
type GetCondition ¶
GetCondition is a function used to retrieve PipelineConditions.
type GetPipeline ¶ added in v0.8.0
GetPipeline is a function used to retrieve Pipelines.
func GetPipelineFunc ¶ added in v0.18.0
func GetPipelineFunc(ctx context.Context, k8s kubernetes.Interface, tekton clientset.Interface, pipelineRun *v1beta1.PipelineRun) (GetPipeline, error)
GetPipelineFunc is a factory function that will use the given PipelineRef to return a valid GetPipeline function that looks up the pipeline. It uses as context a k8s client, tekton client, namespace, and service account name to return the pipeline. It knows whether it needs to look in the cluster or in a remote image to fetch the reference.
type LocalPipelineRefResolver ¶ added in v0.12.0
LocalPipelineRefResolver uses the current cluster to resolve a pipeline reference.
func (*LocalPipelineRefResolver) GetPipeline ¶ added in v0.12.0
func (l *LocalPipelineRefResolver) GetPipeline(ctx context.Context, name string) (v1beta1.PipelineObject, error)
GetPipeline will resolve a Pipeline from the local cluster using a versioned Tekton client. It will return an error if it can't find an appropriate Pipeline for any reason.
type PipelineRunFacts ¶ added in v0.17.0
type PipelineRunFacts struct { State PipelineRunState SpecStatus v1beta1.PipelineRunSpecStatus TasksGraph *dag.Graph FinalTasksGraph *dag.Graph // SkipCache is a hash of PipelineTask names that stores whether a task will be // executed or not, because it's either not reachable via the DAG due to the pipeline // state, or because it has failed conditions. // We cache this data along the state, because it's expensive to compute, it requires // traversing potentially the whole graph; this way it can built incrementally, when // needed, via the `Skip` method in pipelinerunresolution.go // The skip data is sensitive to changes in the state. The ResetSkippedCache method // can be used to clean the cache and force re-computation when needed. SkipCache map[string]TaskSkipStatus ScopeWhenExpressionsToTask bool }
PipelineRunFacts holds the state of all the components that make up the Pipeline graph that are used to track the PipelineRun state without passing all these components separately. It helps simplify our implementation for getting and scheduling the next tasks. It is a collection of list of ResolvedPipelineTask, graph of DAG tasks, graph of finally tasks, cache of skipped tasks, and the scope of when expressions.
func (*PipelineRunFacts) DAGExecutionQueue ¶ added in v0.17.0
func (facts *PipelineRunFacts) DAGExecutionQueue() (PipelineRunState, error)
DAGExecutionQueue returns a list of DAG tasks which needs to be scheduled next
func (*PipelineRunFacts) GetFinalTasks ¶ added in v0.17.0
func (facts *PipelineRunFacts) GetFinalTasks() PipelineRunState
GetFinalTasks returns a list of final tasks without any taskRun associated with it GetFinalTasks returns final tasks only when all DAG tasks have finished executing successfully or skipped or any one DAG task resulted in failure
func (*PipelineRunFacts) GetPipelineConditionStatus ¶ added in v0.17.0
func (facts *PipelineRunFacts) GetPipelineConditionStatus(pr *v1beta1.PipelineRun, logger *zap.SugaredLogger) *apis.Condition
GetPipelineConditionStatus will return the Condition that the PipelineRun prName should be updated with, based on the status of the TaskRuns in state.
func (*PipelineRunFacts) GetPipelineTaskStatus ¶ added in v0.20.0
func (facts *PipelineRunFacts) GetPipelineTaskStatus() map[string]string
GetPipelineTaskStatus returns the status of a PipelineTask depending on its taskRun the checks are implemented such that the finally tasks are requesting status of the dag tasks
func (*PipelineRunFacts) GetSkippedTasks ¶ added in v0.17.0
func (facts *PipelineRunFacts) GetSkippedTasks() []v1beta1.SkippedTask
GetSkippedTasks constructs a list of SkippedTask struct to be included in the PipelineRun Status
func (*PipelineRunFacts) IsGracefullyCancelled ¶ added in v0.25.0
func (facts *PipelineRunFacts) IsGracefullyCancelled() bool
IsGracefullyCancelled returns true if the PipelineRun won't be scheduling any new Task because it was gracefully cancelled
func (*PipelineRunFacts) IsGracefullyStopped ¶ added in v0.25.0
func (facts *PipelineRunFacts) IsGracefullyStopped() bool
IsGracefullyStopped returns true if the PipelineRun won't be scheduling any new Task because it was gracefully stopped
func (*PipelineRunFacts) IsRunning ¶ added in v0.25.0
func (facts *PipelineRunFacts) IsRunning() bool
IsRunning returns true if the PipelineRun is still running tasks in the specified dag
func (*PipelineRunFacts) IsStopping ¶ added in v0.17.0
func (facts *PipelineRunFacts) IsStopping() bool
IsStopping returns true if the PipelineRun won't be scheduling any new Task because at least one task already failed or was cancelled in the specified dag
func (*PipelineRunFacts) ResetSkippedCache ¶ added in v0.18.1
func (facts *PipelineRunFacts) ResetSkippedCache()
ResetSkippedCache resets the skipped cache in the facts map
type PipelineRunState ¶
type PipelineRunState []*ResolvedPipelineRunTask
PipelineRunState is a slice of ResolvedPipelineRunTasks the represents the current execution state of the PipelineRun.
func (PipelineRunState) AdjustStartTime ¶ added in v0.18.0
func (state PipelineRunState) AdjustStartTime(unadjustedStartTime *metav1.Time) *metav1.Time
AdjustStartTime adjusts potential drift in the PipelineRun's start time.
The StartTime will only adjust earlier, so that the PipelineRun's StartTime is no later than any of its constituent TaskRuns.
This drift could be due to us either failing to record the Run's start time previously, or our own failure to observe a prior update before reconciling the resource again.
func (PipelineRunState) GetRunsStatus ¶ added in v0.19.0
func (state PipelineRunState) GetRunsStatus(pr *v1beta1.PipelineRun) map[string]*v1beta1.PipelineRunRunStatus
GetRunsStatus returns a map of run name and the run. Ignore a nil run in pipelineRunState, otherwise, capture run object from PipelineRun Status. Update run status based on the pipelineRunState before returning it in the map.
func (PipelineRunState) GetTaskRunsStatus ¶ added in v0.17.0
func (state PipelineRunState) GetTaskRunsStatus(pr *v1beta1.PipelineRun) map[string]*v1beta1.PipelineRunTaskRunStatus
GetTaskRunsStatus returns a map of taskrun name and the taskrun ignore a nil taskrun in pipelineRunState, otherwise, capture taskrun object from PipelineRun Status update taskrun status based on the pipelineRunState before returning it in the map
func (PipelineRunState) IsBeforeFirstTaskRun ¶ added in v0.12.0
func (state PipelineRunState) IsBeforeFirstTaskRun() bool
IsBeforeFirstTaskRun returns true if the PipelineRun has not yet started its first TaskRun
func (PipelineRunState) ToMap ¶ added in v0.11.0
func (state PipelineRunState) ToMap() map[string]*ResolvedPipelineRunTask
ToMap returns a map that maps pipeline task name to the resolved pipeline run task
type ResolvedConditionCheck ¶
type ResolvedConditionCheck struct { ConditionRegisterName string PipelineTaskCondition *v1beta1.PipelineTaskCondition ConditionCheckName string Condition *v1alpha1.Condition ConditionCheck *v1beta1.ConditionCheck // Resolved resources is a map of pipeline resources for this condition // keyed by the bound resource name (i.e. the name used in PipelineTaskCondition.Resources) ResolvedResources map[string]*resourcev1alpha1.PipelineResource // contains filtered or unexported fields }
ResolvedConditionCheck contains a Condition and its associated ConditionCheck, if it exists. ConditionCheck can be nil to represent there being no ConditionCheck (i.e the condition has not been evaluated).
func (*ResolvedConditionCheck) ConditionToTaskSpec ¶
func (rcc *ResolvedConditionCheck) ConditionToTaskSpec() (*v1beta1.TaskSpec, error)
ConditionToTaskSpec creates a TaskSpec from a given Condition
func (*ResolvedConditionCheck) NewConditionCheckStatus ¶
func (rcc *ResolvedConditionCheck) NewConditionCheckStatus() *v1beta1.ConditionCheckStatus
NewConditionCheckStatus creates a ConditionCheckStatus from a ConditionCheck
func (*ResolvedConditionCheck) ToTaskResourceBindings ¶
func (rcc *ResolvedConditionCheck) ToTaskResourceBindings() []v1beta1.TaskResourceBinding
ToTaskResourceBindings converts pipeline resources in a ResolvedConditionCheck to a list of TaskResourceBinding and returns them.
type ResolvedPipelineRunTask ¶
type ResolvedPipelineRunTask struct { TaskRunName string TaskRun *v1beta1.TaskRun // If the PipelineTask is a Custom Task, RunName and Run will be set. CustomTask bool RunName string Run *v1alpha1.Run PipelineTask *v1beta1.PipelineTask ResolvedTaskResources *resources.ResolvedTaskResources // ConditionChecks ~~TaskRuns but for evaling conditions ResolvedConditionChecks TaskConditionCheckState // Could also be a TaskRun or maybe just a Pod? }
ResolvedPipelineRunTask contains a Task and its associated TaskRun, if it exists. TaskRun can be nil to represent there being no TaskRun.
func ResolvePipelineRunTask ¶ added in v0.18.0
func ResolvePipelineRunTask( ctx context.Context, pipelineRun v1beta1.PipelineRun, getTask resources.GetTask, getTaskRun resources.GetTaskRun, getRun GetRun, getCondition GetCondition, task v1beta1.PipelineTask, providedResources map[string]*resourcev1alpha1.PipelineResource, ) (*ResolvedPipelineRunTask, error)
ResolvePipelineRunTask retrieves a single Task's instance using the getTask to fetch the spec. If it is unable to retrieve an instance of a referenced Task, it will return an error, otherwise it returns a list of all of the Tasks retrieved. It will retrieve the Resources needed for the TaskRun using the mapping of providedResources.
func (ResolvedPipelineRunTask) IsCancelled ¶ added in v0.11.0
func (t ResolvedPipelineRunTask) IsCancelled() bool
IsCancelled returns true only if the run is cancelled
func (ResolvedPipelineRunTask) IsConditionStatusFalse ¶ added in v0.20.0
func (t ResolvedPipelineRunTask) IsConditionStatusFalse() bool
IsConditionStatusFalse returns true when a task has succeeded condition with status set to false it includes task failed after retries are exhausted, cancelled tasks, and time outs
func (ResolvedPipelineRunTask) IsCustomTask ¶ added in v0.19.0
func (t ResolvedPipelineRunTask) IsCustomTask() bool
IsCustomTask returns true if the PipelineTask references a Custom Task.
func (ResolvedPipelineRunTask) IsDone ¶
func (t ResolvedPipelineRunTask) IsDone(facts *PipelineRunFacts) bool
IsDone returns true only if the task is skipped, succeeded or failed
func (ResolvedPipelineRunTask) IsFailure ¶
func (t ResolvedPipelineRunTask) IsFailure() bool
IsFailure returns true only if the run has failed and will not be retried.
func (*ResolvedPipelineRunTask) IsFinalTask ¶ added in v0.25.0
func (t *ResolvedPipelineRunTask) IsFinalTask(facts *PipelineRunFacts) bool
IsFinalTask returns true if a task is a finally task
func (*ResolvedPipelineRunTask) IsFinallySkipped ¶ added in v0.21.0
func (t *ResolvedPipelineRunTask) IsFinallySkipped(facts *PipelineRunFacts) TaskSkipStatus
IsFinallySkipped returns true if a finally task is not executed and skipped due to task result validation failure
func (ResolvedPipelineRunTask) IsRunning ¶ added in v0.25.0
func (t ResolvedPipelineRunTask) IsRunning() bool
IsRunning returns true only if the task is neither succeeded, cancelled nor failed
func (ResolvedPipelineRunTask) IsStarted ¶ added in v0.14.0
func (t ResolvedPipelineRunTask) IsStarted() bool
IsStarted returns true only if the PipelineRunTask itself has a TaskRun or Run associated that has a Succeeded-type condition.
func (ResolvedPipelineRunTask) IsSuccessful ¶
func (t ResolvedPipelineRunTask) IsSuccessful() bool
IsSuccessful returns true only if the run has completed successfully
func (*ResolvedPipelineRunTask) Skip ¶ added in v0.16.0
func (t *ResolvedPipelineRunTask) Skip(facts *PipelineRunFacts) TaskSkipStatus
Skip returns true if a PipelineTask will not be run because (1) its When Expressions evaluated to false (2) its Condition Checks failed (3) its parent task was skipped (4) Pipeline is in stopping state (one of the PipelineTasks failed) (5) Pipeline is gracefully cancelled or stopped Note that this means Skip returns false if a conditionCheck is in progress
type ResolvedResultRef ¶ added in v0.11.0
type ResolvedResultRef struct { Value v1beta1.ArrayOrString ResultReference v1beta1.ResultRef FromTaskRun string FromRun string }
ResolvedResultRef represents a result ref reference that has been fully resolved (value has been populated). If the value is from a Result, then the ResultReference will be populated to point to the ResultReference which resulted in the value
type ResolvedResultRefs ¶ added in v0.11.0
type ResolvedResultRefs []*ResolvedResultRef
ResolvedResultRefs represents all of the ResolvedResultRef for a pipeline task
func ResolveResultRef ¶ added in v0.21.0
func ResolveResultRef(pipelineRunState PipelineRunState, target *ResolvedPipelineRunTask) (ResolvedResultRefs, string, error)
ResolveResultRef resolves any ResultReference that are found in the target ResolvedPipelineRunTask
func ResolveResultRefs ¶ added in v0.11.0
func ResolveResultRefs(pipelineRunState PipelineRunState, targets PipelineRunState) (ResolvedResultRefs, string, error)
ResolveResultRefs resolves any ResultReference that are found in the target ResolvedPipelineRunTask
type SkippingReason ¶ added in v0.27.0
type SkippingReason string
SkippingReason explains why a task was skipped
const ( // WhenExpressionsSkip means the task was skipped due to at least one of its when expressions evaluating to false WhenExpressionsSkip SkippingReason = "WhenExpressionsSkip" // ConditionsSkip means the task was skipped due to at least one of its conditions failing ConditionsSkip SkippingReason = "ConditionsSkip" // ParentTasksSkip means the task was skipped because its parent was skipped ParentTasksSkip SkippingReason = "ParentTasksSkip" // IsStoppingSkip means the task was skipped because the pipeline run is stopping IsStoppingSkip SkippingReason = "IsStoppingSkip" // IsGracefullyCancelledSkip means the task was skipped because the pipeline run has been gracefully cancelled IsGracefullyCancelledSkip SkippingReason = "IsGracefullyCancelledSkip" // IsGracefullyStoppedSkip means the task was skipped because the pipeline run has been gracefully stopped IsGracefullyStoppedSkip SkippingReason = "IsGracefullyStoppedSkip" // MissingResultsSkip means the task was skipped because it's missing necessary results MissingResultsSkip SkippingReason = "MissingResultsSkip" // None means the task was not skipped None SkippingReason = "None" )
type TaskConditionCheckState ¶
type TaskConditionCheckState []*ResolvedConditionCheck
TaskConditionCheckState is a slice of ResolvedConditionCheck the represents the current execution state of Conditions for a Task in a pipeline run.
func (TaskConditionCheckState) HasStarted ¶
func (state TaskConditionCheckState) HasStarted() bool
HasStarted returns true if the conditionChecks for a given object have been created
func (TaskConditionCheckState) IsDone ¶
func (state TaskConditionCheckState) IsDone() bool
IsDone returns true if the status for all conditionChecks for a task indicate that they are done
func (TaskConditionCheckState) IsSuccess ¶
func (state TaskConditionCheckState) IsSuccess() bool
IsSuccess returns true if the status for all conditionChecks for a task indicate they have completed successfully
type TaskNotFoundError ¶
TaskNotFoundError indicates that the resolution failed because a referenced Task couldn't be retrieved
func (*TaskNotFoundError) Error ¶
func (e *TaskNotFoundError) Error() string
type TaskSkipStatus ¶ added in v0.27.0
type TaskSkipStatus struct { IsSkipped bool SkippingReason SkippingReason }
TaskSkipStatus stores whether a task was skipped and why