Documentation ¶
Index ¶
- func ApplyArtifacts(spec *v1.TaskSpec) *v1.TaskSpec
- func ApplyContexts(spec *v1.TaskSpec, taskName string, tr *v1.TaskRun) *v1.TaskSpec
- func ApplyCredentialsPath(spec *v1.TaskSpec, path string) *v1.TaskSpec
- func ApplyParameterSubstitutionInResolverParams(tr *v1.TaskRun, step *v1.Step)
- func ApplyParameters(spec *v1.TaskSpec, tr *v1.TaskRun, defaults ...v1.ParamSpec) *v1.TaskSpec
- func ApplyParametersToWorkspaceBindings(ts *v1.TaskSpec, tr *v1.TaskRun) *v1.TaskRun
- func ApplyReplacements(spec *v1.TaskSpec, stringReplacements map[string]string, ...) *v1.TaskSpec
- func ApplyResults(spec *v1.TaskSpec) *v1.TaskSpec
- func ApplyStepExitCodePath(spec *v1.TaskSpec) *v1.TaskSpec
- func ApplyWorkspaces(ctx context.Context, spec *v1.TaskSpec, declarations []v1.WorkspaceDeclaration, ...) *v1.TaskSpec
- func GetStepActionsData(ctx context.Context, taskSpec v1.TaskSpec, taskRun *v1.TaskRun, ...) ([]v1.Step, error)
- func GetTaskData(ctx context.Context, taskRun *v1.TaskRun, getTask GetTask) (*resolutionutil.ResolvedObjectMeta, *v1.TaskSpec, error)
- func GetTaskKind(taskrun *v1.TaskRun) v1.TaskKind
- func IsErrTransient(err error) bool
- func ValidateOutOfBoundArrayParams(declarations v1.ParamSpecs, params v1.Params, ...) error
- func ValidateParamArrayIndex(ts *v1.TaskSpec, params v1.Params) error
- type GetStepAction
- type GetTask
- type GetTaskRun
- type LocalStepActionRefResolver
- type LocalTaskRefResolver
- type ResolvedTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyArtifacts ¶ added in v0.59.0
ApplyArtifacts replaces the occurrences of step.artifacts.path with the absolute tekton internal path
func ApplyContexts ¶ added in v0.14.0
ApplyContexts applies the substitution from $(context.(taskRun|task).*) with the specified values. Uses "" as a default if a value is not available.
func ApplyCredentialsPath ¶ added in v0.11.0
ApplyCredentialsPath applies a substitution of the key $(credentials.path) with the path that credentials from annotated secrets are written to.
func ApplyParameterSubstitutionInResolverParams ¶ added in v0.59.0
ApplyParameterSubstitutionInResolverParams applies parameter substitutions in resolver params for Step Ref.
func ApplyParameters ¶
ApplyParameters applies the params from a TaskRun.Parameters to a TaskSpec
func ApplyParametersToWorkspaceBindings ¶ added in v0.56.0
ApplyParametersToWorkspaceBindings applies parameters to the WorkspaceBindings of a TaskRun. It takes a TaskSpec and a TaskRun as input and returns the modified TaskRun.
func ApplyReplacements ¶
func ApplyReplacements(spec *v1.TaskSpec, stringReplacements map[string]string, arrayReplacements map[string][]string, objectReplacements map[string]map[string]string) *v1.TaskSpec
ApplyReplacements replaces placeholders for declared parameters with the specified replacements.
func ApplyResults ¶ added in v0.54.0
ApplyResults applies the substitution from values in results and step results which are referenced in spec as subitems of the replacementStr.
func ApplyStepExitCodePath ¶ added in v0.27.0
ApplyStepExitCodePath replaces the occurrences of exitCode path with the absolute tekton internal path Replace $(steps.<step-name>.exitCode.path) with pipeline.StepPath/<step-name>/exitCode
func ApplyWorkspaces ¶ added in v0.10.0
func ApplyWorkspaces(ctx context.Context, spec *v1.TaskSpec, declarations []v1.WorkspaceDeclaration, bindings []v1.WorkspaceBinding, vols map[string]corev1.Volume) *v1.TaskSpec
ApplyWorkspaces applies the substitution from paths that the workspaces in declarations mounted to, the volumes that bindings are realized with in the task spec and the PersistentVolumeClaim names for the workspaces.
func GetStepActionsData ¶ added in v0.54.0
func GetStepActionsData(ctx context.Context, taskSpec v1.TaskSpec, taskRun *v1.TaskRun, tekton clientset.Interface, k8s kubernetes.Interface, requester remoteresource.Requester) ([]v1.Step, error)
GetStepActionsData extracts the StepActions and merges them with the inlined Step specification.
func GetTaskData ¶
func GetTaskData(ctx context.Context, taskRun *v1.TaskRun, getTask GetTask) (*resolutionutil.ResolvedObjectMeta, *v1.TaskSpec, error)
GetTaskData will retrieve the Task metadata and Spec associated with the provided TaskRun. This can come from a reference Task or from the TaskRun's metadata and embedded TaskSpec.
func GetTaskKind ¶ added in v0.25.0
GetTaskKind returns the referenced Task kind (Task, ClusterTask, ...) if the TaskRun is using TaskRef.
func IsErrTransient ¶ added in v0.54.0
IsErrTransient returns true if an error returned by GetTask/GetStepAction is retryable.
func ValidateOutOfBoundArrayParams ¶ added in v0.49.0
func ValidateOutOfBoundArrayParams(declarations v1.ParamSpecs, params v1.Params, arrayIndexingReferences sets.String) error
ValidateOutOfBoundArrayParams returns an error if the array indexing params are out of bounds, based on the param declarations, the parameters passed in at runtime, and the indexing references to array params from a task or pipeline spec. Example of arrayIndexingReferences: ["$(params.a-array-param[1])", "$(params.b-array-param[2])"]
func ValidateParamArrayIndex ¶ added in v0.49.0
ValidateParamArrayIndex validates if the param reference to an array param is out of bound. error is returned when the array indexing reference is out of bound of the array param e.g. if a param reference of $(params.array-param[2]) and the array param is of length 2. - `params` are params from taskrun. - `ts` contains params declarations and references to array params.
Types ¶
type GetStepAction ¶ added in v0.54.0
GetStepAction is a function used to retrieve StepActions.
func GetStepActionFunc ¶ added in v0.54.0
func GetStepActionFunc(tekton clientset.Interface, k8s kubernetes.Interface, requester remoteresource.Requester, tr *v1.TaskRun, step *v1.Step) GetStepAction
GetStepActionFunc is a factory function that will use the given Ref as context to return a valid GetStepAction function. It also requires a kubeclient, tektonclient, requester in case it needs to find that task in cluster or authorize against an external repository. It will figure out whether it needs to look in the cluster or in a remote location to fetch the reference.
type GetTask ¶
type GetTask func(context.Context, string) (*v1.Task, *v1.RefSource, *trustedresources.VerificationResult, error)
GetTask is a function used to retrieve Tasks. VerificationResult is the result from trusted resources if the feature is enabled.
func GetTaskFunc ¶ added in v0.18.0
func GetTaskFunc(ctx context.Context, k8s kubernetes.Interface, tekton clientset.Interface, requester remoteresource.Requester, owner kmeta.OwnerRefable, tr *v1.TaskRef, trName string, namespace, saName string, verificationPolicies []*v1alpha1.VerificationPolicy, ) GetTask
GetTaskFunc is a factory function that will use the given TaskRef as context to return a valid GetTask function. It also requires a kubeclient, tektonclient, namespace, and service account in case it needs to find that task in cluster or authorize against an external repositroy. It will figure out whether it needs to look in the cluster or in a remote image to fetch the reference. It will also return the "kind" of the task being referenced. OCI bundle and remote resolution tasks will be verified by trusted resources if the feature is enabled
func GetTaskFuncFromTaskRun ¶ added in v0.25.0
func GetTaskFuncFromTaskRun(ctx context.Context, k8s kubernetes.Interface, tekton clientset.Interface, requester remoteresource.Requester, taskrun *v1.TaskRun, verificationPolicies []*v1alpha1.VerificationPolicy) GetTask
GetTaskFuncFromTaskRun is a factory function that will use the given TaskRef as context to return a valid GetTask function. It also requires a kubeclient, tektonclient, namespace, and service account in case it needs to find that task in cluster or authorize against an external repositroy. It will figure out whether it needs to look in the cluster or in a remote image to fetch the reference. It will also return the "kind" of the task being referenced. OCI bundle and remote resolution tasks will be verified by trusted resources if the feature is enabled
type GetTaskRun ¶
GetTaskRun is a function used to retrieve TaskRuns
type LocalStepActionRefResolver ¶ added in v0.54.0
LocalStepActionRefResolver uses the current cluster to resolve a StepAction reference.
func (*LocalStepActionRefResolver) GetStepAction ¶ added in v0.54.0
func (l *LocalStepActionRefResolver) GetStepAction(ctx context.Context, name string) (*v1alpha1.StepAction, *v1.RefSource, error)
GetStepAction will resolve a StepAction from the local cluster using a versioned Tekton client. It will return an error if it can't find an appropriate StepAction for any reason.
type LocalTaskRefResolver ¶ added in v0.12.0
type LocalTaskRefResolver struct { Namespace string Kind v1.TaskKind Tektonclient clientset.Interface }
LocalTaskRefResolver uses the current cluster to resolve a task reference.
func (*LocalTaskRefResolver) GetTask ¶ added in v0.12.0
func (l *LocalTaskRefResolver) GetTask(ctx context.Context, name string) (*v1.Task, *v1.RefSource, *trustedresources.VerificationResult, error)
GetTask will resolve either a Task or ClusterTask from the local cluster using a versioned Tekton client. It will return an error if it can't find an appropriate Task for any reason. TODO(#6666): support local task verification
type ResolvedTask ¶ added in v0.46.0
type ResolvedTask struct { TaskName string Kind v1.TaskKind TaskSpec *v1.TaskSpec // VerificationResult is the result from trusted resources if the feature is enabled. VerificationResult *trustedresources.VerificationResult }
ResolvedTask contains the data that is needed to execute the TaskRun.