resources

package
v0.0.0-...-79fe4a6 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2018 The Knative 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.

Index

Constants

View Source
const (
	// ReasonRunning indicates that the reason for the inprogress status is that the TaskRun
	// is just starting to be reconciled
	ReasonRunning = "Running"

	// ReasonFailed indicates that the reason for the failure status is that one of the TaskRuns failed
	ReasonFailed = "Failed"

	// ReasonSucceeded indicates that the reason for the finished status is that all of the TaskRuns
	// completed successfully
	ReasonSucceeded = "Succeeded"
)

Variables

This section is empty.

Functions

func GetOutputSteps

func GetOutputSteps(taskResources []v1alpha1.TaskResourceBinding, taskName string) []v1alpha1.TaskResourceBinding

func GetPipelineConditionStatus

func GetPipelineConditionStatus(prName string, state []*ResolvedPipelineRunTask, logger *zap.SugaredLogger) *duckv1alpha1.Condition

GetPipelineConditionStatus will return the Condition that the PipelineRun prName should be updated with, based on the status of the TaskRuns in state.

func ResolveTaskRuns

func ResolveTaskRuns(getTaskRun GetTaskRun, state []*ResolvedPipelineRunTask) error

ResolveTaskRuns will go through all tasks in state and check if there are existing TaskRuns for each of them by calling getTaskRun.

func ValidateProvidedBy

func ValidateProvidedBy(state []*ResolvedPipelineRunTask) error

ValidateProvidedBy will look at any `providedBy` clauses in the resolved PipelineRun state and validate it: the `providedBy` must specify an input of the current `Task`. The `PipelineTask` it is provided by must actually exist in the `Pipeline`. The `PipelineResource` that is bound to the input must be the same `PipelineResource` that was bound to the output of the previous `Task`. If the state is not valid, it will return an error.

func WrapSteps

func WrapSteps(tr *v1alpha1.TaskRunSpec, pipelineResources []v1alpha1.PipelineTaskResource, pt *v1alpha1.PipelineTask)

Types

type GetTaskRun

type GetTaskRun func(name string) (*v1alpha1.TaskRun, error)

GetTaskRun is a function that will retrieve the TaskRun name.

type ResolvedPipelineRunTask

type ResolvedPipelineRunTask struct {
	TaskRunName           string
	TaskRun               *v1alpha1.TaskRun
	PipelineTask          *v1alpha1.PipelineTask
	ResolvedTaskResources *resources.ResolvedTaskResources
}

ResolvedPipelineRunTask contains a Task and its associated TaskRun, if it exists. TaskRun can be nil to represent there being no TaskRun.

func GetNextTask

func GetNextTask(prName string, state []*ResolvedPipelineRunTask, logger *zap.SugaredLogger) *ResolvedPipelineRunTask

GetNextTask returns the next Task for which a TaskRun should be created, or nil if no TaskRun should be created.

func ResolvePipelineRun

func ResolvePipelineRun(getTask resources.GetTask, getClusterTask resources.GetClusterTask, getResource resources.GetResource, p *v1alpha1.Pipeline, pr *v1alpha1.PipelineRun) ([]*ResolvedPipelineRunTask, error)

ResolvePipelineRun retrieves all Tasks instances which the pipeline p references, getting instances from getTask. 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 as well using getResource.

Jump to

Keyboard shortcuts

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