Documentation
¶
Overview ¶
Copyright 2020 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func Apply(ts v1beta1.TaskSpec, wb []v1beta1.WorkspaceBinding) (*v1beta1.TaskSpec, error)
- func GetVolumes(wb []v1beta1.WorkspaceBinding) map[string]corev1.Volume
- func ValidateBindings(w []v1beta1.WorkspaceDeclaration, wb []v1beta1.WorkspaceBinding) error
- func ValidateOnlyOnePVCIsUsed(wb []v1beta1.WorkspaceBinding) error
Constants ¶
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 = "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 Apply ¶
Apply will update the StepTemplate and Volumes declaration in ts so that the workspaces specified through wb combined with the declared workspaces in ts will be available for all containers in the resulting pod.
func GetVolumes ¶
func GetVolumes(wb []v1beta1.WorkspaceBinding) map[string]corev1.Volume
GetVolumes will return a dictionary where the keys are the names of the workspaces bound in wb and the value is the 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.
func ValidateBindings ¶
func ValidateBindings(w []v1beta1.WorkspaceDeclaration, wb []v1beta1.WorkspaceBinding) error
ValidateBindings will return an error if the bound workspaces in wb don't satisfy the declared workspaces in w.
func ValidateOnlyOnePVCIsUsed ¶ added in v0.16.0
func ValidateOnlyOnePVCIsUsed(wb []v1beta1.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.