Documentation ¶
Index ¶
Constants ¶
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