v1alpha1

package
v0.0.0-...-c27b85c Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the tekton v1alpha1 API group +kubebuilder:object:generate=true +groupName=tekton.hrk091.dev

Index

Constants

This section is empty.

Variables

View Source
var (
	AnnKeyShowDebug = GroupVersion.Group + "/show-debug"
	AnnKeyRetryKey  = GroupVersion.Group + "/retry-key"
)
View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "tekton.hrk091.dev", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	ErrInvalidPinnedSpec = errors.New("assertion error: pinned PipelineSpec is invalid")
)
View Source
var (
	LabelKeyRetryablePipelineRun = GroupVersion.Group + "/retryablePipelineRun"
)

Functions

func RetryKey

func RetryKey(m *metav1.ObjectMeta) string

func ShowDebug

func ShowDebug(m *metav1.ObjectMeta) bool

Types

type CompletedTaskResults

type CompletedTaskResults struct {
	// FromPipelineRun shows the name of PipelineRun where the task result is written.
	FromPipelineRun string `json:"fromPipelineRun,omitempty"`

	// FromTaskRun shows the name of TaskRun where the task result is written.
	FromTaskRun string `json:"fromTaskRun,omitempty"`

	// Results are the list of results written out by the task's containers
	// +optional
	// +listType=atomic
	Results []pipelinev1beta1.TaskRunResult `json:"results,omitempty"`
}

CompletedTaskResults contains the TaskRunResults generated by belonging PipelineRuns.

func (*CompletedTaskResults) DeepCopy

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

func (*CompletedTaskResults) DeepCopyInto

func (in *CompletedTaskResults) DeepCopyInto(out *CompletedTaskResults)

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

type PartialPipelineRunStatus

type PartialPipelineRunStatus struct {
	duckv1beta1.Status `json:",inline"`

	// Name is the name of PipelineRun as well as the primary key of PartialPipelineRunStatus collection.
	Name string `json:"name"`

	// 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"`

	// PipelineResults are the list of results written out by the pipeline task's containers
	// +optional
	// +listType=atomic
	PipelineResults []pipelinev1beta1.PipelineRunResult `json:"pipelineResults,omitempty"`

	// SkippedTasks is the list of tasks that were skipped due to when expressions evaluating to false.
	// +optional
	// +listType=atomic
	SkippedTasks []pipelinev1beta1.SkippedTask `json:"skippedTasks,omitempty"`

	// TaskRuns is the map of PipelineRunTaskRunStatus with the taskRun name as the key.
	// +optional
	TaskRuns map[string]*pipelinev1beta1.PipelineRunTaskRunStatus `json:"taskRuns,omitempty"`
}

PartialPipelineRunStatus contains the fields of belonging PipelineRuns' status.

func (*PartialPipelineRunStatus) CopyFrom

CopyFrom copies the status of given PipelineRun to the list of PipelineRun statuses inside RetryablePipelineRun status.

func (*PartialPipelineRunStatus) DeepCopy

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

func (*PartialPipelineRunStatus) DeepCopyInto

func (in *PartialPipelineRunStatus) DeepCopyInto(out *PartialPipelineRunStatus)

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

func (*PartialPipelineRunStatus) GetCondition

func (s *PartialPipelineRunStatus) GetCondition() *apis.Condition

GetCondition returns the Condition of PartialPipelineRunStatus.

type ReducedPipelineRunCondition

type ReducedPipelineRunCondition struct {
	Tasks map[string]ReducedTaskRunCondition
}

func NewReducedPipelineRunCondition

func NewReducedPipelineRunCondition(rpr *RetryablePipelineRun) *ReducedPipelineRunCondition

func (*ReducedPipelineRunCondition) Stats

type ReducedTaskRunCondition

type ReducedTaskRunCondition struct {
	Condition *apis.Condition
	Started   bool
	Skipped   bool
}

type RetryablePipelineRun

type RetryablePipelineRun struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// +optional
	Spec *RetryablePipelineRunSpec `json:"spec,omitempty"`

	// +kubebuilder:pruning:PreserveUnknownFields
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:Type=object
	// +optional
	Status *RetryablePipelineRunStatus `json:"status,omitempty"`
}

RetryablePipelineRun is the Schema for the retryablepipelineruns API

func (*RetryablePipelineRun) AggregateChildrenResults

func (rpr *RetryablePipelineRun) AggregateChildrenResults()

AggregateChildrenResults aggregates belonging PipelineRun/TaskRun statuses and populates RetryablePipelineRunStatus with their latest statuses.

func (*RetryablePipelineRun) ChildLabels

func (rpr *RetryablePipelineRun) ChildLabels() labels.Set

func (*RetryablePipelineRun) CopyRetryKey

func (rpr *RetryablePipelineRun) CopyRetryKey()

CopyRetryKey copies a retry-key annotation to status.retryKey field.

func (*RetryablePipelineRun) DeepCopy

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

func (*RetryablePipelineRun) DeepCopyInto

func (in *RetryablePipelineRun) DeepCopyInto(out *RetryablePipelineRun)

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

func (*RetryablePipelineRun) DeepCopyObject

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

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

func (*RetryablePipelineRun) InitializeStatus

func (rpr *RetryablePipelineRun) InitializeStatus()

InitializeStatus initializes the RetryablePipelineRun status.

func (*RetryablePipelineRun) IsPipelineSpecPinned

func (rpr *RetryablePipelineRun) IsPipelineSpecPinned() bool

IsPipelineSpecPinned returns true when the PipelineSpec is already pinned.

func (*RetryablePipelineRun) IsRetryKeyChanged

func (rpr *RetryablePipelineRun) IsRetryKeyChanged() bool

IsRetryKeyChanged returns true when a retry-key annotation is changed from the previous value.

func (*RetryablePipelineRun) IsTaskSpecPinned

func (rpr *RetryablePipelineRun) IsTaskSpecPinned(pipelineTaskName string) (bool, error)

IsTaskSpecPinned returns true when the TaskSpec of given PipelineTask is already pinned.

func (*RetryablePipelineRun) NewPipelineRun

func (rpr *RetryablePipelineRun) NewPipelineRun(name string) *pipelinev1beta1.PipelineRun

NewPipelineRun returns a new PipelineRun with using given spec as RetryablePipelineRunSpec.

func (*RetryablePipelineRun) NewRetryPipelineRun

func (rpr *RetryablePipelineRun) NewRetryPipelineRun(name string) *pipelinev1beta1.PipelineRun

NewRetryPipelineRun returns a new PipelineRun with using pinned PipelineRun Spec, applying results replacement and skipping already completed PipelineTasks.

func (*RetryablePipelineRun) NextPipelineRunName

func (rpr *RetryablePipelineRun) NextPipelineRunName() string

NextPipelineRunName returns a name of PipelineRun that should be used for the next PipelineRun.

func (*RetryablePipelineRun) PinPipelineSpecFrom

func (rpr *RetryablePipelineRun) PinPipelineSpecFrom(pr *pipelinev1beta1.PipelineRun) bool

PinPipelineSpecFrom copies resolved PipelineSpec and metadata to RetryablePipelineRunStatus.PinnedPipelineRun to pin spec and metadata of the first PipelineRun and enable to reuse them for building retry PipelineRun. It returns false when PipelineSpec is not resolved yet and it is unable to copy it.

func (*RetryablePipelineRun) PinTaskSpecFrom

func (rpr *RetryablePipelineRun) PinTaskSpecFrom(pr *pipelinev1beta1.PipelineRun, pipelineTaskName string) (bool, error)

PinTaskSpecFrom copies resolved TaskSpec to RetryablePipelineRunStatus.PinnedPipelineRun to pin TaskSpec of the first TaskRun and enable to reuse them for building retry PipelineRun. It returns false when TaskSpec is not resolved yet and it is unable to copy it.

func (*RetryablePipelineRun) PipelineRunStatus

func (rpr *RetryablePipelineRun) PipelineRunStatus(name string) *PartialPipelineRunStatus

PipelineRunStatus returns the latest status of given PipelineRun from the copies inside RetryablePipelineRun status.

func (*RetryablePipelineRun) PipelineTaskNames

func (rpr *RetryablePipelineRun) PipelineTaskNames() ([]string, error)

PipelineTaskNames returns a PipelineTask name list defined at Pinned PipelineSpec.

func (*RetryablePipelineRun) ReserveNextPipelineRunName

func (rpr *RetryablePipelineRun) ReserveNextPipelineRunName() bool

ReserveNextPipelineRunName reserves a name of PipelineRun to be created at the next reconcile loop.

func (*RetryablePipelineRun) StartedPipelineRunCount

func (rpr *RetryablePipelineRun) StartedPipelineRunCount() int

StartedPipelineRunCount returns the number of child PipelineRuns already started.

func (*RetryablePipelineRun) UpdateCondition

func (rpr *RetryablePipelineRun) UpdateCondition() *TaskRunStatusCount

UpdateCondition calculates current condition and sets it into its status.

type RetryablePipelineRunList

type RetryablePipelineRunList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RetryablePipelineRun `json:"items"`
}

RetryablePipelineRunList contains a list of RetryablePipelineRun

func (*RetryablePipelineRunList) DeepCopy

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

func (*RetryablePipelineRunList) DeepCopyInto

func (in *RetryablePipelineRunList) DeepCopyInto(out *RetryablePipelineRunList)

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

func (*RetryablePipelineRunList) DeepCopyObject

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

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

type RetryablePipelineRunSpec

type RetryablePipelineRunSpec struct {
	*pipelinev1beta1.PipelineRunSpec `json:",inline"`
}

RetryablePipelineRunSpec defines the desired state of RetryablePipelineRun

func (*RetryablePipelineRunSpec) DeepCopy

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

func (*RetryablePipelineRunSpec) DeepCopyInto

func (in *RetryablePipelineRunSpec) DeepCopyInto(out *RetryablePipelineRunSpec)

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

type RetryablePipelineRunStatus

type RetryablePipelineRunStatus struct {
	duckv1beta1.Status `json:",inline"`

	// StartTime is the time the RetryablePipelineRun is actually started.
	// +optional
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// CompletionTime is the time the RetryablePipelineRun completed.
	// +optional
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`

	// PinnedPipelineRun contains the exact spec used to instantiate the first run.
	PinnedPipelineRun *pipelinev1beta1.PipelineRun `json:"pinnedPipelineRun,omitempty"`

	// PipelineRuns is the list of child PipelineRun status copies with using its name as the merge key.
	// +optional
	PipelineRuns []*PartialPipelineRunStatus `json:"pipelineRuns,omitempty"`

	// TaskResults is the map of TaskResult with the PipelineTask name as the key.
	// +optional
	TaskResults map[string]*CompletedTaskResults `json:"taskResults,omitempty"`

	// PipelineResults is the list of results written out by the pipeline task's containers.
	// +optional
	// +listType=atomic
	PipelineResults []pipelinev1beta1.PipelineRunResult `json:"pipelineResults,omitempty"`

	// RetryKey is the copy of retry-key annotation to compare with its previous value.
	RetryKey string
}

RetryablePipelineRunStatus defines the observed state of RetryablePipelineRun.

func (*RetryablePipelineRunStatus) DeepCopy

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

func (*RetryablePipelineRunStatus) DeepCopyInto

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

func (*RetryablePipelineRunStatus) GetCondition

func (s *RetryablePipelineRunStatus) GetCondition() *apis.Condition

GetCondition returns the Condition of RetryablePipelineRun.

func (*RetryablePipelineRunStatus) HasCancelled

func (s *RetryablePipelineRunStatus) HasCancelled() bool

HasCancelled returns true if the RetryablePipelineRun has been cancelled.

func (*RetryablePipelineRunStatus) HasDone

func (s *RetryablePipelineRunStatus) HasDone() bool

HasDone returns true if the RetryablePipelineRun has been succeeded/completed/failed.

func (*RetryablePipelineRunStatus) HasStarted

func (s *RetryablePipelineRunStatus) HasStarted() bool

HasStarted returns whether RetryablePipelineRun has valid start time set in its status.

func (*RetryablePipelineRunStatus) HasSucceeded

func (s *RetryablePipelineRunStatus) HasSucceeded() bool

HasSucceeded returns true if the RetryablePipelineRun has been succeeded.

func (*RetryablePipelineRunStatus) InitializeConditions

func (s *RetryablePipelineRunStatus) InitializeConditions()

InitializeConditions will set all conditions in condset to unknown for the RetryablePipelineRun and set the started time to the current time.

func (*RetryablePipelineRunStatus) MarkFailed

func (s *RetryablePipelineRunStatus) MarkFailed(reason, format string, msgs ...interface{})

MarkFailed changes the Succeeded condition to False with the provided reason and message.

func (*RetryablePipelineRunStatus) MarkRunning

func (s *RetryablePipelineRunStatus) MarkRunning(reason, format string, msgs ...interface{})

MarkRunning changes the Succeeded condition to Unknown with the provided reason and message.

func (*RetryablePipelineRunStatus) MarkSucceeded

func (s *RetryablePipelineRunStatus) MarkSucceeded(reason, format string, msgs ...interface{})

MarkSucceeded changes the Succeeded condition to True with the provided reason and message.

func (*RetryablePipelineRunStatus) ResolvedResultRefs

ResolvedResultRefs converts completed TaskRun results to the list of pipelinerun.ResolvedResultRef in order to utilize it for variable substitution.

func (*RetryablePipelineRunStatus) SetCondition

func (s *RetryablePipelineRunStatus) SetCondition(newCond *apis.Condition)

SetCondition sets the condition, unsetting previous conditions with the same type.

type TaskRunStatusCount

type TaskRunStatusCount struct {
	All        int
	Skipped    int
	NotStarted int
	Incomplete int
	Succeeded  int
	Failed     int
	Cancelled  int
}

func (*TaskRunStatusCount) ChangedFrom

func (c *TaskRunStatusCount) ChangedFrom(prev *TaskRunStatusCount) bool

func (*TaskRunStatusCount) Info

func (c *TaskRunStatusCount) Info() string

func (*TaskRunStatusCount) IsCancelled

func (c *TaskRunStatusCount) IsCancelled() bool

func (*TaskRunStatusCount) IsFailed

func (c *TaskRunStatusCount) IsFailed() bool

func (*TaskRunStatusCount) IsRunning

func (c *TaskRunStatusCount) IsRunning() bool

func (*TaskRunStatusCount) IsSucceeded

func (c *TaskRunStatusCount) IsSucceeded() bool

Jump to

Keyboard shortcuts

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