workspace

package
v0.62.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// LabelInstance is used in combination with LabelComponent to configure PodAffinity for TaskRun pods
	LabelInstance = "app.kubernetes.io/instance"

	// LabelComponent is used to configure PodAntiAffinity to other Affinity Assistants
	LabelComponent = "app.kubernetes.io/component"
	// ComponentNameAffinityAssistant is the component name for an Affinity Assistant
	ComponentNameAffinityAssistant = "affinity-assistant"

	// AnnotationAffinityAssistantName is used to pass the instance name of an Affinity Assistant to TaskRun pods
	AnnotationAffinityAssistantName = "pipeline.tekton.dev/affinity-assistant"
)

Variables

This section is empty.

Functions

func AddSidecarVolumeMount added in v0.24.0

func AddSidecarVolumeMount(sidecar *v1.Sidecar, volumeMount corev1.VolumeMount)

AddSidecarVolumeMount is a helper to add a volumeMount to the sidecar unless its MountPath would conflict with another of the sidecar's existing volume mounts.

func Apply

func Apply(ctx context.Context, ts v1.TaskSpec, wb []v1.WorkspaceBinding, v map[string]corev1.Volume) (*v1.TaskSpec, error)

Apply will update the StepTemplate, Sidecars and Volumes declaration in ts so that the workspaces specified through wb combined with the declared workspaces in ts will be available for all Step and Sidecar containers in the resulting pod.

func CreateVolumes added in v0.17.0

func CreateVolumes(wb []v1.WorkspaceBinding) map[string]corev1.Volume

CreateVolumes will return a dictionary where the keys are the names of the workspaces bound in wb and the value is a newly-created Volume to use. If the same Volume is bound twice, the resulting volumes will both have the same name to prevent the same Volume from being attached to a pod twice. The names of the returned volumes will be a short hash string starting "ws-".

func FindWorkspacesUsedByTask added in v0.40.0

func FindWorkspacesUsedByTask(ts v1.TaskSpec) (sets.String, error)

FindWorkspacesUsedByTask returns a set of all the workspaces that the TaskSpec uses.

func ReplaceWorkspaceBindingsVars added in v0.58.0

func ReplaceWorkspaceBindingsVars(wbs []v1.WorkspaceBinding, replacements map[string]string) []v1.WorkspaceBinding

ReplaceWorkspaceBindingsVars returns a new slice of WorkspaceBinding with references to parameters replaced, based on the mapping provided in replacements.

func ValidateBindings

func ValidateBindings(ctx context.Context, decls []v1.WorkspaceDeclaration, binds []v1.WorkspaceBinding) error

ValidateBindings will return an error if the bound workspaces in binds don't satisfy the declared workspaces in decls.

func ValidateOnlyOnePVCIsUsed added in v0.16.0

func ValidateOnlyOnePVCIsUsed(wb []v1.WorkspaceBinding) error

ValidateOnlyOnePVCIsUsed checks that a list of WorkspaceBinding uses only one persistent volume claim.

This is only useful to validate that WorkspaceBindings in TaskRuns are compatible with affinity rules enforced by the AffinityAssistant.

Types

This section is empty.

Jump to

Keyboard shortcuts

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