volumeclaim

package
v0.0.0-...-4fc8c9b Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReasonCouldntCreateWorkspacePVC indicates that a Pipeline expects a workspace from a
	// volumeClaimTemplate but couldn't create a claim.
	ReasonCouldntCreateWorkspacePVC = "CouldntCreateWorkspacePVC"
)

Variables

This section is empty.

Functions

func GeneratePVCNameFromWorkspaceBinding

func GeneratePVCNameFromWorkspaceBinding(claimName string, wb v1.WorkspaceBinding, owner metav1.OwnerReference) string

GeneratePVCNameFromWorkspaceBinding gets the name of PersistentVolumeClaim for a Workspace and PipelineRun or TaskRun. claim must be a PersistentVolumeClaim from a volumeClaimTemplate. The returned name must be consistent given the same workspaceBinding name and ownerReference UID - because it is first used for creating a PVC and later, possibly several TaskRuns to lookup the PVC to mount. We use ownerReference UID over ownerReference name to distinguish runs with the same name. If the given volumeClaimTemplate name is empty, the prefix "pvc" will be applied to the PersistentVolumeClaim name. See function `getPersistentVolumeClaimNameWithAffinityAssistant` when the PersistentVolumeClaim is created by Affinity Assistant StatefulSet.

Types

type PvcHandler

type PvcHandler interface {
	CreatePVCFromVolumeClaimTemplate(ctx context.Context, wb v1.WorkspaceBinding, ownerReference metav1.OwnerReference, namespace string) error
	PurgeFinalizerAndDeletePVCForWorkspace(ctx context.Context, pvcName, namespace string) error
}

PvcHandler is used to create PVCs for workspaces

func NewPVCHandler

func NewPVCHandler(clientset clientset.Interface, logger *zap.SugaredLogger) PvcHandler

NewPVCHandler returns a new defaultPVCHandler

Jump to

Keyboard shortcuts

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