Documentation ¶
Index ¶
- Constants
- func ApplyParametersToPipeline(p *v1beta1.PipelineSpec, cpr *cprv1alpha1.ColocatedPipelineRun) *v1beta1.PipelineSpec
- func ApplyParametersToTask(spec *v1beta1.TaskSpec, pt *v1beta1.PipelineTask, ...) *v1beta1.TaskSpec
- func ApplyWorkspacesToPipeline(p *v1beta1.PipelineSpec, cpr *cprv1alpha1.ColocatedPipelineRun) *v1beta1.PipelineSpec
- func ApplyWorkspacesToTasks(ctx context.Context, runMeta metav1.ObjectMeta, ...) (map[string]corev1.Volume, map[string][]corev1.VolumeMount, error)
- func ContainerName(taskName, stepName string, i int) string
- func DecodeExtraFields(run v1alpha1.RunSpec, into interface{}) error
- func EncodeExtraFields(run *v1alpha1.RunSpec, from interface{}) error
- func GetPipelineData(ctx context.Context, run *cprv1alpha1.ColocatedPipelineRun, ...) (*metav1.ObjectMeta, *v1beta1.PipelineSpec, error)
- func IsContainerStep(name string) bool
- func IsPodExceedingNodeResources(pod *corev1.Pod) bool
- func IsSidecarStatusRunning(tr *v1beta1.TaskRun) bool
- func MakeColocatedPipelineRunStatus(logger *zap.SugaredLogger, cpr cprv1alpha1.ColocatedPipelineRun, ...) (cprv1alpha1.ColocatedPipelineRunStatus, error)
- func NewController(opts *pipeline.Options) func(ctx context.Context, cmw configmap.Watcher) *controller.Impl
- func StepName(name string, i int) string
- func StopSidecars(ctx context.Context, nopImage string, kubeclient kubernetes.Interface, ...) (*corev1.Pod, error)
- func TaskAndStepNameFromContainerName(name string) (string, string, error)
- func ToColocatedPipelineRun(run *v1alpha1.Run) (cprv1alpha1.ColocatedPipelineRun, error)
- func TrimSidecarPrefix(name string) string
- func UpdateReady(ctx context.Context, kubeclient kubernetes.Interface, pod corev1.Pod) error
- func UpdateRunFromColocatedPipelineRun(run *v1alpha1.Run, cpr cprv1alpha1.ColocatedPipelineRun) error
- func ValidateWorkspaceBindings(p *v1beta1.PipelineSpec, cpr *v1alpha1.ColocatedPipelineRun) error
- type EntrypointCache
- type GetPipeline
- type Reconciler
- type StepInfo
Constants ¶
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" )
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" )
const (
ControllerName = "pipelineinpod-controller"
)
const (
ReleaseAnnotation = "pipeline.tekton.dev/release"
)
Variables ¶
This section is empty.
Functions ¶
func ApplyParametersToPipeline ¶
func ApplyParametersToPipeline(p *v1beta1.PipelineSpec, cpr *cprv1alpha1.ColocatedPipelineRun) *v1beta1.PipelineSpec
func ApplyParametersToTask ¶
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 DecodeExtraFields ¶
func EncodeExtraFields ¶
func GetPipelineData ¶
func GetPipelineData(ctx context.Context, run *cprv1alpha1.ColocatedPipelineRun, getPipeline GetPipeline) (*metav1.ObjectMeta, *v1beta1.PipelineSpec, error)
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 ¶
IsContainerStep returns true if the container name indicates that it represents a step.
func IsPodExceedingNodeResources ¶
IsPodExceedingNodeResources returns true if the Pod's status indicates there are insufficient resources to schedule the Pod.
func IsSidecarStatusRunning ¶
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 StepName ¶
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 ToColocatedPipelineRun ¶
func ToColocatedPipelineRun(run *v1alpha1.Run) (cprv1alpha1.ColocatedPipelineRun, error)
func TrimSidecarPrefix ¶
TrimSidecarPrefix returns the container name, stripped of its sidecar prefix.
func UpdateReady ¶
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 ¶
GetPipeline is a function used to retrieve Pipelines.
func GetPipelineFunc ¶
func GetPipelineFunc(ctx context.Context, k8s kubernetes.Interface, tekton clientset.Interface, cpr *cprv1alpha1.ColocatedPipelineRun) (GetPipeline, error)
type Reconciler ¶
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.