ephemeral

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 20

Documentation

Overview

Package ephemeral provides code that supports the usual pattern for accessing the PVC that provides a generic ephemeral inline volume:

- determine the PVC name that corresponds to the inline volume source - retrieve the PVC - verify that the PVC is owned by the pod - use the PVC

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VolumeClaimName

func VolumeClaimName(pod *v1.Pod, volume *v1.Volume) string

VolumeClaimName returns the name of the PersistentVolumeClaim object that gets created for the generic ephemeral inline volume. The name is deterministic and therefore this function does not need any additional information besides the Pod name and volume name and it will never fail.

Before using the PVC for the Pod, the caller must check that it is indeed the PVC that was created for the Pod by calling IsUsable.

func VolumeIsForPod

func VolumeIsForPod(pod *v1.Pod, pvc *v1.PersistentVolumeClaim) error

VolumeIsForPod checks that the PVC is the ephemeral volume that was created for the Pod. It returns an error that is informative enough to be returned by the caller without adding further details about the Pod or PVC.

Types

This section is empty.

Jump to

Keyboard shortcuts

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