utils

package
v1.60.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPopulated

func IsPopulated(pvc *corev1.PersistentVolumeClaim, getDvFunc func(name, namespace string) (*cdiv1.DataVolume, error)) (bool, error)

IsPopulated indicates if the persistent volume passed in has been fully populated. It follow the following logic 1. If the PVC is not owned by a DataVolume, return true, we assume someone else has properly populated the image 2. If the PVC is owned by a DataVolume, look up the DV and check the phase, if phase succeeded return true 3. If the PVC is owned by a DataVolume, look up the DV and check the phase, if phase !succeeded return false

func IsWaitForFirstConsumerBeforePopulating

func IsWaitForFirstConsumerBeforePopulating(pvc *corev1.PersistentVolumeClaim, getDvFunc func(name, namespace string) (*cdiv1.DataVolume, error)) (bool, error)

IsWaitForFirstConsumerBeforePopulating indicates if the persistent volume passed in is in ClaimPending state and waiting for first consumer. It follow the following logic 1. If the PVC is not owned by a DataVolume, return false, we can not assume it will be populated 2. If the PVC is owned by a DataVolume, look up the DV and check the phase, if phase WaitForFirstConsumer return true 3. If the PVC is owned by a DataVolume, look up the DV and check the phase, if phase !WaitForFirstConsumer return false

Types

This section is empty.

Jump to

Keyboard shortcuts

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