types

package
v0.59.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigName        = "config"
	DefaultFSOverhead = cdiv1.Percent("0.055")
	FSOverheadMsg     = "Using default 5.5%% filesystem overhead for pvc size"
)
View Source
const MiB = 1024 * 1024

Variables

View Source
var ErrFailedToFindCdi error = errors.New("No CDI instances found")
View Source
var ErrMultipleCdiInstances error = errors.New("Detected more than one CDI instance")

Functions

func DataVolumeByNameFunc added in v0.58.0

func DataVolumeByNameFunc(dataVolumeInformer cache.SharedInformer, dataVolumes []*cdiv1.DataVolume) func(name string, namespace string) (*cdiv1.DataVolume, error)

func DataVolumeFailed added in v0.58.0

func DataVolumeFailed(dv *cdiv1.DataVolume) bool

func DataVolumeWFFC added in v0.58.0

func DataVolumeWFFC(dv *cdiv1.DataVolume) bool

func GenerateDataVolumeFromTemplate added in v0.58.0

func GenerateDataVolumeFromTemplate(clientset kubecli.KubevirtClient, dataVolumeTemplate virtv1.DataVolumeTemplateSpec, namespace, priorityClassName string) (*cdiv1.DataVolume, error)

func GetDataVolumeFromCache added in v0.58.0

func GetDataVolumeFromCache(namespace, name string, dataVolumeInformer cache.SharedInformer) (*cdiv1.DataVolume, error)

func GetFilesystemOverhead

func GetFilesystemOverhead(volumeMode *k8sv1.PersistentVolumeMode, storageClass *string, cdiConfig *cdiv1.CDIConfig) cdiv1.Percent

func GetPersistentVolumeClaimFromCache added in v0.58.0

func GetPersistentVolumeClaimFromCache(namespace, name string, pvcInformer cache.SharedInformer) (*k8sv1.PersistentVolumeClaim, error)

func GetSizeIncludingDefaultFSOverhead added in v0.58.0

func GetSizeIncludingDefaultFSOverhead(size *resource.Quantity) (*resource.Quantity, error)

func GetSizeIncludingFSOverhead

func GetSizeIncludingFSOverhead(size *resource.Quantity, storageClass *string, volumeMode *k8sv1.PersistentVolumeMode, cdiConfig *cdiv1.CDIConfig) (*resource.Quantity, error)

func GetSizeIncludingGivenOverhead

func GetSizeIncludingGivenOverhead(size *resource.Quantity, overhead cdiv1.Percent) (*resource.Quantity, error)

func HasDataVolumeErrors added in v0.58.0

func HasDataVolumeErrors(namespace string, volumes []virtv1.Volume, dataVolumeInformer cache.SharedInformer) error

func HasDataVolumeProvisioning added in v0.58.0

func HasDataVolumeProvisioning(namespace string, volumes []virtv1.Volume, dataVolumeInformer cache.SharedInformer) bool

func HasFailedDataVolumes added in v0.58.0

func HasFailedDataVolumes(dvs []*cdiv1.DataVolume) bool

func HasSharedAccessMode

func HasSharedAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool

func HasUnboundPVC added in v0.58.0

func HasUnboundPVC(namespace string, volumes []virtv1.Volume, pvcInformer cache.SharedInformer) bool

func HasWFFCDataVolumes added in v0.58.0

func HasWFFCDataVolumes(dvs []*cdiv1.DataVolume) bool

func IsPVCBlock

func IsPVCBlock(volumeMode *k8sv1.PersistentVolumeMode) bool

func IsPVCBlockFromStore

func IsPVCBlockFromStore(store cache.Store, namespace string, claimName string) (pvc *k8sv1.PersistentVolumeClaim, exists bool, isBlockDevice bool, err error)

func IsPreallocated

func IsPreallocated(annotations map[string]string) bool

func IsReadOnlyAccessMode

func IsReadOnlyAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool

func ListDataVolumesFromTemplates added in v0.58.0

func ListDataVolumesFromTemplates(namespace string, dvTemplates []virtv1.DataVolumeTemplateSpec, dataVolumeInformer cache.SharedInformer) ([]*cdiv1.DataVolume, error)

func ListDataVolumesFromVolumes added in v0.58.0

func ListDataVolumesFromVolumes(namespace string, volumes []virtv1.Volume, dataVolumeInformer cache.SharedInformer, pvcInformer cache.SharedInformer) ([]*cdiv1.DataVolume, error)

func PVCNameFromVirtVolume

func PVCNameFromVirtVolume(volume *virtv1.Volume) string

func RenderPVC added in v0.58.0

func RenderPVC(size *resource.Quantity, claimName, namespace, storageClass, accessMode string, blockVolume bool) *k8sv1.PersistentVolumeClaim

func VirtVolumesToPVCMap

func VirtVolumesToPVCMap(volumes []*virtv1.Volume, pvcStore cache.Store, namespace string) (map[string]*k8sv1.PersistentVolumeClaim, error)

func VolumeReadyToAttachToNode added in v0.58.0

func VolumeReadyToAttachToNode(namespace string, volume virtv1.Volume, dataVolumes []*cdiv1.DataVolume, dataVolumeInformer, pvcInformer cache.SharedInformer) (bool, bool, error)

Types

type CloneSource

type CloneSource struct {
	Namespace string
	Name      string
}

func GetCloneSource

func GetCloneSource(ctx context.Context, client kubecli.KubevirtClient, namespace string, dvSpec *cdiv1.DataVolumeSpec) (*CloneSource, error)

func GetCloneSourceWithInformers

func GetCloneSourceWithInformers(vm *virtv1.VirtualMachine, dvSpec *cdiv1.DataVolumeSpec, dataSourceInformer cache.SharedInformer) (*CloneSource, error)

type DataVolumeConditionManager added in v0.58.0

type DataVolumeConditionManager struct {
}

func NewDataVolumeConditionManager added in v0.58.0

func NewDataVolumeConditionManager() *DataVolumeConditionManager

func (*DataVolumeConditionManager) GetCondition added in v0.58.0

func (*DataVolumeConditionManager) HasCondition added in v0.58.0

func (*DataVolumeConditionManager) HasConditionWithStatus added in v0.58.0

func (d *DataVolumeConditionManager) HasConditionWithStatus(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType, status v1.ConditionStatus) bool

func (*DataVolumeConditionManager) HasConditionWithStatusAndReason added in v0.58.0

func (d *DataVolumeConditionManager) HasConditionWithStatusAndReason(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType, status v1.ConditionStatus, reason string) bool

type PvcNotFoundError added in v0.58.0

type PvcNotFoundError struct {
	Reason string
}

func (PvcNotFoundError) Error added in v0.58.0

func (e PvcNotFoundError) Error() string

Jump to

Keyboard shortcuts

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