types

package
v1.4.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigName        = "config"
	DefaultFSOverhead = virtv1.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(dataVolumeStore cache.Store, 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, dataVolumeStore cache.Store) (*cdiv1.DataVolume, error)

func GetDiskCapacity added in v1.3.0

func GetDiskCapacity(pvcInfo *virtv1.PersistentVolumeClaimInfo) *int64

Get expected disk capacity - a minimum between the request and the PVC capacity. Returns nil when we have insufficient data to calculate this minimum.

func GetDisksByName added in v1.2.1

func GetDisksByName(vmiSpec *virtv1.VirtualMachineInstanceSpec) map[string]*virtv1.Disk

func GetFilesystemOverhead

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

func GetFilesystemsFromVolumes added in v1.3.0

func GetFilesystemsFromVolumes(vmi *virtv1.VirtualMachineInstance) map[string]*virtv1.Filesystem

func GetPVCsFromVolumes added in v0.59.0

func GetPVCsFromVolumes(volumes []virtv1.Volume) map[string]string

func GetPersistentVolumeClaimFromCache added in v0.58.0

func GetPersistentVolumeClaimFromCache(namespace, name string, pvcStore cache.Store) (*k8sv1.PersistentVolumeClaim, error)

func GetResolvedCloneSource added in v1.0.1

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

GetResolvedCloneSource resolves the clone source of a datavolume with sourceRef This will be moved to the CDI API package

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 virtv1.Percent) (*resource.Quantity, error)

func GetTotalSizeMigratedVolumes added in v1.3.0

func GetTotalSizeMigratedVolumes(vmi *virtv1.VirtualMachineInstance) *resource.Quantity

func GetVolumesByName added in v1.2.1

func GetVolumesByName(vmiSpec *virtv1.VirtualMachineInstanceSpec) map[string]*virtv1.Volume

func HasDataVolumeErrors added in v0.58.0

func HasDataVolumeErrors(namespace string, volumes []virtv1.Volume, dataVolumeStore cache.Store) error

func HasDataVolumeProvisioning added in v0.58.0

func HasDataVolumeProvisioning(namespace string, volumes []virtv1.Volume, dataVolumeStore cache.Store) 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, pvcStore cache.Store) bool

func HasWFFCDataVolumes added in v0.58.0

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

func IsDataVolumeGarbageCollected added in v1.2.1

func IsDataVolumeGarbageCollected(pvc *k8sv1.PersistentVolumeClaim) bool

func IsHotplugVolume added in v1.2.1

func IsHotplugVolume(vol *virtv1.Volume) bool

func IsMigratedVolume added in v1.3.0

func IsMigratedVolume(name string, vmi *virtv1.VirtualMachineInstance) 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 IsReadWriteOnceAccessMode added in v1.3.0

func IsReadWriteOnceAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool

func ListDataVolumesFromTemplates added in v0.58.0

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

func ListDataVolumesFromVolumes added in v0.58.0

func ListDataVolumesFromVolumes(namespace string, volumes []virtv1.Volume, dataVolumeStore cache.Store, pvcStore cache.Store) ([]*cdiv1.DataVolume, error)

func Min added in v1.3.0

func Min(one, two int64) int64

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, dataVolumeStore, pvcStore cache.Store) (bool, bool, error)

Types

type CloneSource

type CloneSource struct {
	Namespace string
	Name      string
}

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