Documentation ¶
Index ¶
- Constants
- Variables
- func DataVolumeByNameFunc(dataVolumeInformer cache.SharedInformer, 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, dataVolumeInformer cache.SharedInformer) (*cdiv1.DataVolume, error)
- func GetFilesystemOverhead(volumeMode *k8sv1.PersistentVolumeMode, storageClass *string, ...) cdiv1.Percent
- func GetPVCsFromVolumes(volumes []virtv1.Volume) map[string]string
- func GetPersistentVolumeClaimFromCache(namespace, name string, pvcInformer cache.SharedInformer) (*k8sv1.PersistentVolumeClaim, 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 cdiv1.Percent) (*resource.Quantity, error)
- func HasDataVolumeErrors(namespace string, volumes []virtv1.Volume, ...) error
- func HasDataVolumeProvisioning(namespace string, volumes []virtv1.Volume, ...) bool
- func HasFailedDataVolumes(dvs []*cdiv1.DataVolume) bool
- func HasSharedAccessMode(accessModes []k8sv1.PersistentVolumeAccessMode) bool
- func HasUnboundPVC(namespace string, volumes []virtv1.Volume, pvcInformer cache.SharedInformer) bool
- func HasWFFCDataVolumes(dvs []*cdiv1.DataVolume) 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 ListDataVolumesFromTemplates(namespace string, dvTemplates []virtv1.DataVolumeTemplateSpec, ...) ([]*cdiv1.DataVolume, error)
- func ListDataVolumesFromVolumes(namespace string, volumes []virtv1.Volume, ...) ([]*cdiv1.DataVolume, error)
- 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 = 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 GetPVCsFromVolumes ¶ added in v0.59.0
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 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 IsPVCBlock ¶
func IsPVCBlock(volumeMode *k8sv1.PersistentVolumeMode) bool
func IsPVCBlockFromStore ¶
func IsPreallocated ¶
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 VirtVolumesToPVCMap ¶
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 ¶
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 (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.