v1alpha1

package
Version: v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 351

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the pipeline v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/tektoncd/pipeline/pkg/apis/pipeline +k8s:defaulter-gen=TypeMeta +groupName=tekton.dev

Index

Constants

This section is empty.

Variables

View Source
var (

	// AddToScheme adds Build types to the scheme.
	AddToScheme = schemeBuilder.AddToScheme
)
View Source
var (
	// InvalidResourcePatternErr is returned when the pattern is not valid regex expression
	InvalidResourcePatternErr = "resourcePattern cannot be compiled by regex"
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: pipeline.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

View Source
var SupportedSignatureAlgorithms = map[HashAlgorithm]crypto.Hash{
	// contains filtered or unexported fields
}

SupportedSignatureAlgorithms sets a list of support signature algorithms that is similar to the list supported by cosign. empty HashAlgorithm is allowed and will be set to SHA256.

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Authority added in v0.43.0

type Authority struct {
	// Name is the name for this authority.
	Name string `json:"name"`
	// Key contains the public key to validate the resource.
	Key *KeyRef `json:"key,omitempty"`
}

The Authority block defines the keys for validating signatures.

func (*Authority) DeepCopy added in v0.43.0

func (in *Authority) DeepCopy() *Authority

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Authority.

func (*Authority) DeepCopyInto added in v0.43.0

func (in *Authority) DeepCopyInto(out *Authority)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EmbeddedRunSpec added in v0.25.0

type EmbeddedRunSpec struct {
	runtime.TypeMeta `json:",inline"`

	// +optional
	Metadata v1beta1.PipelineTaskMetadata `json:"metadata,omitempty"`

	// Spec is a specification of a custom task
	// +optional
	Spec runtime.RawExtension `json:"spec,omitempty"`
}

EmbeddedRunSpec allows custom task definitions to be embedded

func (*EmbeddedRunSpec) DeepCopy added in v0.25.0

func (in *EmbeddedRunSpec) DeepCopy() *EmbeddedRunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmbeddedRunSpec.

func (*EmbeddedRunSpec) DeepCopyInto added in v0.25.0

func (in *EmbeddedRunSpec) DeepCopyInto(out *EmbeddedRunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HashAlgorithm added in v0.43.0

type HashAlgorithm string

HashAlgorithm defines the hash algorithm used for the public key

type KeyRef added in v0.43.0

type KeyRef struct {
	// SecretRef sets a reference to a secret with the key.
	// +optional
	SecretRef *v1.SecretReference `json:"secretRef,omitempty"`
	// Data contains the inline public key.
	// +optional
	Data string `json:"data,omitempty"`
	// KMS contains the KMS url of the public key
	// Supported formats differ based on the KMS system used.
	// One example of a KMS url could be:
	// gcpkms://projects/[PROJECT]/locations/[LOCATION]>/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[KEY_VERSION]
	// For more examples please refer https://docs.sigstore.dev/cosign/kms_support.
	// Note that the KMS is not supported yet.
	// +optional
	KMS string `json:"kms,omitempty"`
	// HashAlgorithm always defaults to sha256 if the algorithm hasn't been explicitly set
	// +optional
	HashAlgorithm HashAlgorithm `json:"hashAlgorithm,omitempty"`
}

KeyRef defines the reference to a public key

func (*KeyRef) DeepCopy added in v0.43.0

func (in *KeyRef) DeepCopy() *KeyRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyRef.

func (*KeyRef) DeepCopyInto added in v0.43.0

func (in *KeyRef) DeepCopyInto(out *KeyRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*KeyRef) Validate added in v0.43.0

func (key *KeyRef) Validate(ctx context.Context) (errs *apis.FieldError)

Validate KeyRef will check if one of KeyRef's Data or SecretRef exists, and the Supported HashAlgorithm is in supportedSignatureAlgorithms.

type ResourcePattern added in v0.43.0

type ResourcePattern struct {
	// Pattern defines a resource pattern. Regex is created to filter resources based on `Pattern`
	// Example patterns:
	// GitHub resource: https://github.com/tektoncd/catalog.git, https://github.com/tektoncd/*
	// Bundle resource: gcr.io/tekton-releases/catalog/upstream/git-clone, gcr.io/tekton-releases/catalog/upstream/*
	// Hub resource: https://artifacthub.io/*,
	Pattern string `json:"pattern"`
}

ResourcePattern defines the pattern of the resource source

func (*ResourcePattern) DeepCopy added in v0.43.0

func (in *ResourcePattern) DeepCopy() *ResourcePattern

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePattern.

func (*ResourcePattern) DeepCopyInto added in v0.43.0

func (in *ResourcePattern) DeepCopyInto(out *ResourcePattern)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourcePattern) Validate added in v0.43.0

func (r *ResourcePattern) Validate(ctx context.Context) (errs *apis.FieldError)

Validate ResourcePattern and make sure the Pattern is valid regex expression

type Run added in v0.15.0

type Run struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// +optional
	Spec RunSpec `json:"spec,omitempty"`
	// +optional
	Status RunStatus `json:"status,omitempty"`
}

Run represents a single execution of a Custom Task.

+k8s:openapi-gen=true

func (*Run) DeepCopy added in v0.15.0

func (in *Run) DeepCopy() *Run

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Run.

func (*Run) DeepCopyInto added in v0.15.0

func (in *Run) DeepCopyInto(out *Run)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Run) DeepCopyObject added in v0.15.0

func (in *Run) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Run) GetConditionSet added in v0.15.0

func (r *Run) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*Run) GetGroupVersionKind added in v0.27.0

func (*Run) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable.

func (*Run) GetRetryCount added in v0.43.0

func (r *Run) GetRetryCount() int

GetRetryCount returns the number of times this Run has already been retried

func (*Run) GetRunKey added in v0.15.0

func (r *Run) GetRunKey() string

GetRunKey return the run's key for timeout handler map

func (*Run) GetStatus added in v0.15.0

func (r *Run) GetStatus() *duckv1.Status

GetStatus retrieves the status of the Parallel. Implements the KRShaped interface.

func (*Run) GetStatusCondition added in v0.34.0

func (r *Run) GetStatusCondition() apis.ConditionAccessor

GetStatusCondition returns the task run status as a ConditionAccessor

func (*Run) GetTimeout added in v0.27.0

func (r *Run) GetTimeout() time.Duration

GetTimeout returns the timeout for this run, or the default if not configured

func (*Run) HasPipelineRunOwnerReference added in v0.15.0

func (r *Run) HasPipelineRunOwnerReference() bool

HasPipelineRunOwnerReference returns true of Run has owner reference of type PipelineRun

func (*Run) HasStarted added in v0.15.0

func (r *Run) HasStarted() bool

HasStarted function check whether taskrun has valid start time set in its status

func (*Run) HasTimedOut added in v0.27.0

func (r *Run) HasTimedOut(c clock.PassiveClock) bool

HasTimedOut returns true if the Run's running time is beyond the allowed timeout

func (*Run) IsCancelled added in v0.17.0

func (r *Run) IsCancelled() bool

IsCancelled returns true if the Run's spec status is set to Cancelled state

func (*Run) IsDone added in v0.15.0

func (r *Run) IsDone() bool

IsDone returns true if the Run's status indicates that it is done.

func (*Run) IsSuccessful added in v0.15.0

func (r *Run) IsSuccessful() bool

IsSuccessful returns true if the Run's status indicates that it is done.

func (*Run) SetDefaults added in v0.15.0

func (r *Run) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*Run) SupportedVerbs added in v0.41.0

func (r *Run) SupportedVerbs() []admissionregistrationv1.OperationType

SupportedVerbs returns the operations that validation should be called for

func (*Run) Validate added in v0.15.0

func (r *Run) Validate(ctx context.Context) *apis.FieldError

Validate taskrun

type RunList added in v0.15.0

type RunList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Run `json:"items"`
}

RunList contains a list of Run

func (*RunList) DeepCopy added in v0.15.0

func (in *RunList) DeepCopy() *RunList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunList.

func (*RunList) DeepCopyInto added in v0.15.0

func (in *RunList) DeepCopyInto(out *RunList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RunList) DeepCopyObject added in v0.15.0

func (in *RunList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RunReason added in v0.42.0

type RunReason string

RunReason is an enum used to store all Run reason for the Succeeded condition that are controlled by the Run itself.

const (
	// RunReasonStarted is the reason set when the Run has just started.
	RunReasonStarted RunReason = "Started"
	// RunReasonRunning is the reason set when the Run is running.
	RunReasonRunning RunReason = "Running"
	// RunReasonSuccessful is the reason set when the Run completed successfully.
	RunReasonSuccessful RunReason = "Succeeded"
	// RunReasonFailed is the reason set when the Run completed with a failure.
	RunReasonFailed RunReason = "Failed"
	// RunReasonCancelled must be used in the Condition Reason to indicate that a Run was cancelled.
	RunReasonCancelled RunReason = "RunCancelled"
	// RunReasonTimedOut must be used in the Condition Reason to indicate that a Run was timed out.
	RunReasonTimedOut RunReason = "RunTimedOut"
	// RunReasonWorkspaceNotSupported can be used in the Condition Reason to indicate that the
	// Run contains a workspace which is not supported by this custom task.
	RunReasonWorkspaceNotSupported RunReason = "RunWorkspaceNotSupported"
	// RunReasonPodTemplateNotSupported can be used in the Condition Reason to indicate that the
	// Run contains a pod template which is not supported by this custom task.
	RunReasonPodTemplateNotSupported RunReason = "RunPodTemplateNotSupported"
)

func (RunReason) String added in v0.42.0

func (t RunReason) String() string

type RunResult added in v0.19.0

type RunResult = runv1alpha1.RunResult

RunResult used to describe the results of a task

type RunSpec added in v0.15.0

type RunSpec struct {
	// +optional
	Ref *v1beta1.TaskRef `json:"ref,omitempty"`

	// Spec is a specification of a custom task
	// +optional
	Spec *EmbeddedRunSpec `json:"spec,omitempty"`

	// +optional
	Params []v1beta1.Param `json:"params,omitempty"`

	// Used for cancelling a run (and maybe more later on)
	// +optional
	Status RunSpecStatus `json:"status,omitempty"`

	// Status message for cancellation.
	// +optional
	StatusMessage RunSpecStatusMessage `json:"statusMessage,omitempty"`

	// Used for propagating retries count to custom tasks
	// +optional
	Retries int `json:"retries,omitempty"`

	// +optional
	ServiceAccountName string `json:"serviceAccountName"`

	// PodTemplate holds pod specific configuration
	// +optional
	PodTemplate *pod.PodTemplate `json:"podTemplate,omitempty"`

	// Time after which the custom-task times out.
	// Refer Go's ParseDuration documentation for expected format: https://golang.org/pkg/time/#ParseDuration
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// Workspaces is a list of WorkspaceBindings from volumes to workspaces.
	// +optional
	Workspaces []v1beta1.WorkspaceBinding `json:"workspaces,omitempty"`
}

RunSpec defines the desired state of Run

func (*RunSpec) DeepCopy added in v0.15.0

func (in *RunSpec) DeepCopy() *RunSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunSpec.

func (*RunSpec) DeepCopyInto added in v0.15.0

func (in *RunSpec) DeepCopyInto(out *RunSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (RunSpec) GetParam added in v0.15.0

func (rs RunSpec) GetParam(name string) *v1beta1.Param

GetParam gets the Param from the RunSpec with the given name TODO(jasonhall): Move this to a Params type so other code can use it?

func (*RunSpec) SetDefaults added in v0.15.0

func (rs *RunSpec) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*RunSpec) Validate added in v0.15.0

func (rs *RunSpec) Validate(ctx context.Context) *apis.FieldError

Validate Run spec

type RunSpecStatus added in v0.17.0

type RunSpecStatus string

RunSpecStatus defines the taskrun spec status the user can provide

const (
	// RunSpecStatusCancelled indicates that the user wants to cancel the run,
	// if not already cancelled or terminated
	RunSpecStatusCancelled RunSpecStatus = "RunCancelled"
)

type RunSpecStatusMessage added in v0.39.0

type RunSpecStatusMessage string

RunSpecStatusMessage defines human readable status messages for the TaskRun.

const (
	// RunCancelledByPipelineMsg indicates that the PipelineRun of which part this Run was
	// has been cancelled.
	RunCancelledByPipelineMsg RunSpecStatusMessage = "Run cancelled as the PipelineRun it belongs to has been cancelled."
	// RunCancelledByPipelineTimeoutMsg indicates that the Run was cancelled because the PipelineRun running it timed out.
	RunCancelledByPipelineTimeoutMsg RunSpecStatusMessage = "Run cancelled as the PipelineRun it belongs to has timed out."
)

type RunStatus added in v0.15.0

type RunStatus = runv1alpha1.RunStatus

RunStatus defines the observed state of Run.

type RunStatusFields added in v0.15.0

type RunStatusFields = runv1alpha1.RunStatusFields

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.

type VerificationPolicy added in v0.43.0

type VerificationPolicy struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// Spec holds the desired state of the VerificationPolicy.
	Spec VerificationPolicySpec `json:"spec"`
}

VerificationPolicy defines the rules to verify Tekton resources. VerificationPolicy can config the mapping from resources to a list of public keys, so when verifying the resources we can use the corresponding public keys. +k8s:openapi-gen=true

func (*VerificationPolicy) DeepCopy added in v0.43.0

func (in *VerificationPolicy) DeepCopy() *VerificationPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerificationPolicy.

func (*VerificationPolicy) DeepCopyInto added in v0.43.0

func (in *VerificationPolicy) DeepCopyInto(out *VerificationPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VerificationPolicy) DeepCopyObject added in v0.43.0

func (in *VerificationPolicy) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*VerificationPolicy) GetGroupVersionKind added in v0.43.0

func (*VerificationPolicy) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable.

func (*VerificationPolicy) SetDefaults added in v0.43.0

func (v *VerificationPolicy) SetDefaults(ctx context.Context)

SetDefaults implements apis.Defaultable

func (*VerificationPolicy) Validate added in v0.43.0

func (v *VerificationPolicy) Validate(ctx context.Context) (errs *apis.FieldError)

Validate VerificationPolicy

type VerificationPolicyList added in v0.43.0

type VerificationPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []VerificationPolicy `json:"items"`
}

VerificationPolicyList contains a list of VerificationPolicy +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*VerificationPolicyList) DeepCopy added in v0.43.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerificationPolicyList.

func (*VerificationPolicyList) DeepCopyInto added in v0.43.0

func (in *VerificationPolicyList) DeepCopyInto(out *VerificationPolicyList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VerificationPolicyList) DeepCopyObject added in v0.43.0

func (in *VerificationPolicyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type VerificationPolicySpec added in v0.43.0

type VerificationPolicySpec struct {
	// Resources defines the patterns of resources sources that should be subject to this policy.
	// For example, we may want to apply this Policy from a certain GitHub repo.
	// Then the ResourcesPattern should be valid regex. E.g. If using gitresolver, and we want to config keys from a certain git repo.
	// `ResourcesPattern` can be `https://github.com/tektoncd/catalog.git`, we will use regex to filter out those resources.
	Resources []ResourcePattern `json:"resources"`
	// Authorities defines the rules for validating signatures.
	Authorities []Authority `json:"authorities"`
}

VerificationPolicySpec defines the patterns and authorities.

func (*VerificationPolicySpec) DeepCopy added in v0.43.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerificationPolicySpec.

func (*VerificationPolicySpec) DeepCopyInto added in v0.43.0

func (in *VerificationPolicySpec) DeepCopyInto(out *VerificationPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VerificationPolicySpec) Validate added in v0.43.0

func (vs *VerificationPolicySpec) Validate(ctx context.Context) (errs *apis.FieldError)

Validate VerificationPolicySpec, the validation requires Resources is not empty, for each resource it must be able to be regex expression and can be compiled with no error. The Authorities shouldn't be empty and each Authority should be valid.

Jump to

Keyboard shortcuts

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