pod

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package pod provides methods for converting between a TaskRun and a Pod.

Index

Constants

View Source
const (
	ManagedByLabelKey   = "app.kubernetes.io/managed-by"
	ManagedByLabelValue = "tekton-pipelines"
)
View Source
const (
	// reasonCouldntGetTask indicates that the reason for the failure status is that the
	// Task couldn't be found
	ReasonCouldntGetTask = "CouldntGetTask"

	// reasonFailedResolution indicated that the reason for failure status is
	// that references within the TaskRun could not be resolved
	ReasonFailedResolution = "TaskRunResolutionFailed"

	// reasonFailedValidation indicated that the reason for failure status is
	// that taskrun failed runtime validation
	ReasonFailedValidation = "TaskRunValidationFailed"

	// reasonRunning indicates that the reason for the inprogress status is that the TaskRun
	// is just starting to be reconciled
	ReasonRunning = "Running"

	// reasonTimedOut indicates that the TaskRun has taken longer than its configured timeout
	ReasonTimedOut = "TaskRunTimeout"

	// reasonExceededResourceQuota indicates that the TaskRun failed to create a pod due to
	// a ResourceQuota in the namespace
	ReasonExceededResourceQuota = "ExceededResourceQuota"

	// reasonExceededNodeResources indicates that the TaskRun's pod has failed to start due
	// to resource constraints on the node
	ReasonExceededNodeResources = "ExceededNodeResources"

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

	// ReasonFailed indicates that the reason for the failure status is unknown or that one of the steps failed
	ReasonFailed = "Failed"
)

Variables

This section is empty.

Functions

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 MakePod

func MakePod(images pipeline.Images, taskRun *v1alpha1.TaskRun, taskSpec v1alpha1.TaskSpec, kubeclient kubernetes.Interface, entrypointCache EntrypointCache) (*corev1.Pod, error)

MakePod converts TaskRun and TaskSpec objects to a Pod which implements the taskrun specified by the supplied CRD.

func MakeTaskRunStatus

func MakeTaskRunStatus(tr v1alpha1.TaskRun, pod *corev1.Pod, taskSpec v1alpha1.TaskSpec) v1alpha1.TaskRunStatus

MakeTaskRunStatus returns a TaskRunStatus based on the Pod's status.

func SidecarsReady

func SidecarsReady(podStatus corev1.PodStatus) bool

SidecarsReady returns true if all of the Pod's sidecars are Ready or Terminated.

func StopSidecars

func StopSidecars(nopImage string, kubeclient kubernetes.Interface, pod corev1.Pod) error

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

func UpdateReady

func UpdateReady(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.

Types

type EntrypointCache

type EntrypointCache interface {
	Get(imageName, namespace, serviceAccountName string) (cmd []string, d name.Digest, err error)
}

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.

Jump to

Keyboard shortcuts

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