...

Package storage

Overview ▾

func GetAutomountVolumes

func GetAutomountVolumes(configAutomountClient configAutomount.Client, containers, initContainers []corev1.Container) ([]corev1.Volume, error)

func GetEphemeralVolumesAndVolumeMounts

func GetEphemeralVolumesAndVolumeMounts(devfileObj devfileParser.DevfileObj, containers []corev1.Container, initContainers []corev1.Container, ephemerals map[string]storage.Storage, options parsercommon.DevfileOptions) ([]corev1.Volume, error)

func GetPersistentVolumesAndVolumeMounts

func GetPersistentVolumesAndVolumeMounts(devfileObj devfileParser.DevfileObj, containers []corev1.Container, initContainers []corev1.Container, volumeNameToVolInfo map[string]VolumeInfo, options parsercommon.DevfileOptions) ([]corev1.Volume, error)

GetPersistentVolumesAndVolumeMounts gets the PVC volumes and updates the containers with the volume mounts. volumeNameToVolInfo is a map of the devfile volume name to the volume info containing the pvc name and the volume name. To be moved to devfile/library.

func GetVolumeInfos

func GetVolumeInfos(pvcs []corev1.PersistentVolumeClaim) (odoSourcePVCName string, infos map[string]VolumeInfo, _ error)

GetVolumeInfos returns the PVC name attached to the `odo-projects` directory and a map of other PVCs

func HandleOdoSourceStorage

func HandleOdoSourceStorage(client kclient.ClientInterface, storageClient storage.Client, componentName string, isEphemeral bool) error

HandleOdoSourceStorage creates or deletes the volume containing project sources, based on the preference setting - if Ephemeral preference is true, any PVC with labels "component=..." and "odo-source-pvc=odo-projects" is removed - if Ephemeral preference is false and no PVC with matching labels exists, it is created

type VolumeInfo

VolumeInfo is a struct to hold the pvc name and the volume name to create a volume. To be moved to devfile/library.

type VolumeInfo struct {
    PVCName    string
    VolumeName string
}