Documentation ¶
Index ¶
- Constants
- Variables
- func DataVolumeByNameFunc(dataVolumeStore cache.Store, dataVolumes []*cdiv1.DataVolume) func(name string, namespace string) (*cdiv1.DataVolume, error)
- func DataVolumeFailed(dv *cdiv1.DataVolume) bool
- func DataVolumeWFFC(dv *cdiv1.DataVolume) bool
- func GenerateDataVolumeFromTemplate(clientset kubecli.KubevirtClient, ...) (*cdiv1.DataVolume, error)
- func GetDataVolumeFromCache(namespace, name string, dataVolumeStore cache.Store) (*cdiv1.DataVolume, error)
- func GetDiskCapacity(pvcInfo *virtv1.PersistentVolumeClaimInfo) *int64
- func GetDisksByName(vmiSpec *virtv1.VirtualMachineInstanceSpec) map[string]*virtv1.Disk
- func GetFilesystemOverhead(volumeMode *k8sv1.PersistentVolumeMode, storageClass *string, ...) virtv1.Percent
- func GetFilesystemsFromVolumes(vmi *virtv1.VirtualMachineInstance) map[string]*virtv1.Filesystem
- func GetPVCsFromVolumes(volumes []virtv1.Volume) map[string]string
- func GetPersistentVolumeClaimFromCache(namespace, name string, pvcStore cache.Store) (*k8sv1.PersistentVolumeClaim, error)
- func GetResolvedCloneSource(ctx context.Context, client kubecli.KubevirtClient, namespace string, ...) (*cdiv1.DataVolumeSource, error)
- func GetSizeIncludingDefaultFSOverhead(size *resource.Quantity) (*resource.Quantity, error)
- func GetSizeIncludingFSOverhead(size *resource.Quantity, storageClass *string, ...) (*resource.Quantity, error)
- func GetSizeIncludingGivenOverhead(size *resource.Quantity, overhead virtv1.Percent) (*resource.Quantity, error)
- func GetTotalSizeMigratedVolumes(vmi *virtv1.VirtualMachineInstance) *resource.Quantity
- func GetVolumesByName(vmiSpec *virtv1.VirtualMachineInstanceSpec) map[string]*virtv1.Volume
- func HasDataVolumeErrors(namespace string, volumes []virtv1.Volume, dataVolumeStore cache.Store) error
- func HasDataVolumeProvisioning(namespace string, volumes []virtv1.Volume, dataVolumeStore cache.Store) bool
- func HasFailedDataVolumes(dvs []*cdiv1.DataVolume) bool
- func HasSharedAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool
- func HasUnboundPVC(namespace string, volumes []virtv1.Volume, pvcStore cache.Store) bool
- func HasWFFCDataVolumes(dvs []*cdiv1.DataVolume) bool
- func IsDataVolumeGarbageCollected(pvc *k8sv1.PersistentVolumeClaim) bool
- func IsHotplugVolume(vol *virtv1.Volume) bool
- func IsMigratedVolume(name string, vmi *virtv1.VirtualMachineInstance) bool
- func IsPVCBlock(volumeMode *k8sv1.PersistentVolumeMode) bool
- func IsPVCBlockFromStore(store cache.Store, namespace string, claimName string) (pvc *k8sv1.PersistentVolumeClaim, exists bool, isBlockDevice bool, err error)
- func IsPreallocated(annotations map[string]string) bool
- func IsReadOnlyAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool
- func IsReadWriteOnceAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool
- func ListDataVolumesFromTemplates(namespace string, dvTemplates []virtv1.DataVolumeTemplateSpec, ...) ([]*cdiv1.DataVolume, error)
- func ListDataVolumesFromVolumes(namespace string, volumes []virtv1.Volume, dataVolumeStore cache.Store, ...) ([]*cdiv1.DataVolume, error)
- func Min(one, two int64) int64
- func PVCNameFromVirtVolume(volume *virtv1.Volume) string
- func RenderPVC(size *resource.Quantity, claimName, namespace, storageClass, accessMode string, ...) *k8sv1.PersistentVolumeClaim
- func VirtVolumesToPVCMap(volumes []*virtv1.Volume, pvcStore cache.Store, namespace string) (map[string]*k8sv1.PersistentVolumeClaim, error)
- func VolumeReadyToAttachToNode(namespace string, volume virtv1.Volume, dataVolumes []*cdiv1.DataVolume, ...) (bool, bool, error)
- type CloneSource
- type DataVolumeConditionManager
- func (d *DataVolumeConditionManager) GetCondition(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType) *cdiv1.DataVolumeCondition
- func (d *DataVolumeConditionManager) HasCondition(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType) bool
- func (d *DataVolumeConditionManager) HasConditionWithStatus(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType, ...) bool
- func (d *DataVolumeConditionManager) HasConditionWithStatusAndReason(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType, ...) bool
- type PvcNotFoundError
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 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 GetFilesystemsFromVolumes ¶ added in v1.3.0
func GetFilesystemsFromVolumes(vmi *virtv1.VirtualMachineInstance) map[string]*virtv1.Filesystem
func GetPVCsFromVolumes ¶ added in v0.59.0
func GetPersistentVolumeClaimFromCache ¶ added in v0.58.0
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 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 HasDataVolumeProvisioning ¶ added in v0.58.0
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 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 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 IsPreallocated ¶
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 PVCNameFromVirtVolume ¶
func VirtVolumesToPVCMap ¶
Types ¶
type CloneSource ¶
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 (d *DataVolumeConditionManager) GetCondition(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType) *cdiv1.DataVolumeCondition
func (*DataVolumeConditionManager) HasCondition ¶ added in v0.58.0
func (d *DataVolumeConditionManager) HasCondition(dv *cdiv1.DataVolume, cond cdiv1.DataVolumeConditionType) bool
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
Click to show internal directories.
Click to hide internal directories.