pipelineinpod

package
v0.0.0-...-8ee384e Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonCouldntGetPipeline = "ReasonCouldntGetPipeline"
	// ReasonRunFailedValidation indicates that the reason for failure status is that Run failed validation
	ReasonRunFailedValidation     = "ReasonRunFailedValidation"
	ReasonParameterMissing        = "ReasonParameterMissing"
	ReasonTimedOut                = "ReasonTimedOut"
	ReasonCouldntGetTask          = "ReasonCouldntGetTask"
	ReasonInvalidWorkspaceBinding = "ReasonInvalidWorkspaceBinding"
)
View Source
const (
	// ReasonExceededNodeResources indicates that the TaskRun's pod has failed to start due
	// to resource constraints on the node
	ReasonExceededNodeResources = "ExceededNodeResources"

	// ReasonCreateContainerConfigError indicates that the TaskRun failed to create a pod due to
	// config error of container
	ReasonCreateContainerConfigError = "CreateContainerConfigError"

	// ReasonPending indicates that the pod is in corev1.Pending, and the reason is not
	// ReasonExceededNodeResources or isPodHitConfigError
	ReasonPending = "Pending"
)
View Source
const (
	ControllerName = "pipelineinpod-controller"
)
View Source
const (
	ReleaseAnnotation = "pipeline.tekton.dev/release"
)

Variables

This section is empty.

Functions

func ApplyParametersToTask

func ApplyParametersToTask(spec *v1beta1.TaskSpec, pt *v1beta1.PipelineTask, defaults ...v1beta1.ParamSpec) *v1beta1.TaskSpec

func ApplyWorkspacesToPipeline

func ApplyWorkspacesToPipeline(p *v1beta1.PipelineSpec, cpr *cprv1alpha1.ColocatedPipelineRun) *v1beta1.PipelineSpec

ApplyWorkspacesToPipeline replaces workspace variables in the given pipeline spec with their concrete values.

func ApplyWorkspacesToTasks

func ApplyWorkspacesToTasks(ctx context.Context, runMeta metav1.ObjectMeta, cpr *cprv1alpha1.ColocatedPipelineRun) (map[string]corev1.Volume, map[string][]corev1.VolumeMount, error)

ApplyWorkspacesToTasks creates volumes for workspaces, replaces workspace path variables, and returns a mapping of workspace names (as specified in the pipeline) to volumes and a mapping of pipeline task name to volume mounts.

func ContainerName

func ContainerName(taskName, stepName string, i int) string

func DecodeExtraFields

func DecodeExtraFields(run v1alpha1.RunSpec, into interface{}) error

func EncodeExtraFields

func EncodeExtraFields(run *v1alpha1.RunSpec, from interface{}) error

func GetPipelineData

GetPipelineData will retrieve the Pipeline metadata and Spec associated with the provided Run. This can come from a reference Pipeline or from the Run's metadata and embedded PipelineSpec.

func IsContainerStep

func IsContainerStep(name string) bool

IsContainerStep returns true if the container name indicates that it represents a step.

func IsPodExceedingNodeResources

func IsPodExceedingNodeResources(pod *corev1.Pod) bool

IsPodExceedingNodeResources returns true if the Pod's status indicates there are insufficient resources to schedule the Pod.

func IsSidecarStatusRunning

func IsSidecarStatusRunning(tr *v1beta1.TaskRun) bool

IsSidecarStatusRunning determines if any SidecarStatus on a TaskRun is still running.

func MakeColocatedPipelineRunStatus

func MakeColocatedPipelineRunStatus(logger *zap.SugaredLogger, cpr cprv1alpha1.ColocatedPipelineRun, pod *corev1.Pod) (cprv1alpha1.ColocatedPipelineRunStatus, error)

sorts pod containers into the respective tasks creates taskrun status by calling maketaskrunstatus applies taskrun statuses to the pipelinerun

func NewController

func NewController(opts *pipeline.Options) func(ctx context.Context, cmw configmap.Watcher) *controller.Impl

func StepName

func StepName(name string, i int) string

StepName returns the step name after adding "step-" prefix to the actual step name or returns "step-unnamed-<step-index>" if not specified

func StopSidecars

func StopSidecars(ctx context.Context, nopImage string, kubeclient kubernetes.Interface, namespace, name string) (*corev1.Pod, error)

StopSidecars updates sidecar containers in the Pod to a nop image, which exits successfully immediately.

func TaskAndStepNameFromContainerName

func TaskAndStepNameFromContainerName(name string) (string, string, error)

func ToColocatedPipelineRun

func ToColocatedPipelineRun(run *v1alpha1.Run) (cprv1alpha1.ColocatedPipelineRun, error)

func TrimSidecarPrefix

func TrimSidecarPrefix(name string) string

TrimSidecarPrefix returns the container name, stripped of its sidecar prefix.

func UpdateReady

func UpdateReady(ctx context.Context, kubeclient kubernetes.Interface, pod corev1.Pod) error

UpdateReady updates the Pod's annotations to signal the first step to start by projecting the ready annotation via the Downward API.

func UpdateRunFromColocatedPipelineRun

func UpdateRunFromColocatedPipelineRun(run *v1alpha1.Run, cpr cprv1alpha1.ColocatedPipelineRun) error

func ValidateWorkspaceBindings

func ValidateWorkspaceBindings(p *v1beta1.PipelineSpec, cpr *v1alpha1.ColocatedPipelineRun) error

ValidateWorkspaceBindings validates that the Workspaces expected by a Pipeline are provided by a ColocatedPipelineRun.

Types

type EntrypointCache

type EntrypointCache interface {
	// contains filtered or unexported methods
}

EntrypointCache looks up an image's entrypoint (command) in a container image registry, possibly using the given service account's credentials.

func NewEntrypointCache

func NewEntrypointCache(kubeclient kubernetes.Interface) (EntrypointCache, error)

NewEntrypointCache returns a new entrypoint cache implementation that uses K8s credentials to pull image metadata from a container image registry.

type GetPipeline

type GetPipeline func(context.Context, string) (v1beta1.PipelineObject, error)

GetPipeline is a function used to retrieve Pipelines.

type Reconciler

type Reconciler struct {
	Images pipeline.Images
	// contains filtered or unexported fields
}

Reconciler implements controller.Reconciler for Run resources.

func (*Reconciler) ReconcileKind

func (r *Reconciler) ReconcileKind(ctx context.Context, run *v1alpha1.Run) reconciler.Event

ReconcileKind implements Interface.ReconcileKind.

type StepInfo

type StepInfo map[string]string

Jump to

Keyboard shortcuts

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