Documentation ¶
Index ¶
- Constants
- func CalculateRestoreResourceQuotaWithVMI(rq *corev1.ResourceQuota, vmi *kubevirtv1.VirtualMachineInstance, ...) (needUpdate bool, toUpdate *corev1.ResourceQuota)
- func CalculateScaleResourceQuotaWithVMI(rq *corev1.ResourceQuota, vmi *kubevirtv1.VirtualMachineInstance) (needUpdate bool, toUpdate *corev1.ResourceQuota, rl corev1.ResourceList)
- func ContainsMigratingVM(rq *corev1.ResourceQuota, vmName string) bool
- func GetResourceListFromMigratingVM(rq *corev1.ResourceQuota, vmName string) (corev1.ResourceList, error)
- func GetResourceListFromMigratingVMs(rq *corev1.ResourceQuota) (map[string]corev1.ResourceList, error)
- func HasMigratingVM(rq *corev1.ResourceQuota) bool
- func IsInsufficientResourceError(err error) bool
- func RemoveMigratingVM(rq *corev1.ResourceQuota, vmName string)
- func UpdateMigratingVM(rq *corev1.ResourceQuota, vmName string, rl corev1.ResourceList) error
- type Calculator
- type InsufficientResourceError
Constants ¶
View Source
const (
ErrInsufficientResourcesFMT = "%s insufficient resources due to resource quota"
)
Variables ¶
This section is empty.
Functions ¶
func CalculateRestoreResourceQuotaWithVMI ¶
func CalculateRestoreResourceQuotaWithVMI( rq *corev1.ResourceQuota, vmi *kubevirtv1.VirtualMachineInstance, rl corev1.ResourceList, ) (needUpdate bool, toUpdate *corev1.ResourceQuota)
func CalculateScaleResourceQuotaWithVMI ¶
func CalculateScaleResourceQuotaWithVMI( rq *corev1.ResourceQuota, vmi *kubevirtv1.VirtualMachineInstance, ) (needUpdate bool, toUpdate *corev1.ResourceQuota, rl corev1.ResourceList)
func ContainsMigratingVM ¶
func ContainsMigratingVM(rq *corev1.ResourceQuota, vmName string) bool
func GetResourceListFromMigratingVM ¶
func GetResourceListFromMigratingVM(rq *corev1.ResourceQuota, vmName string) (corev1.ResourceList, error)
func GetResourceListFromMigratingVMs ¶
func GetResourceListFromMigratingVMs(rq *corev1.ResourceQuota) (map[string]corev1.ResourceList, error)
func HasMigratingVM ¶
func HasMigratingVM(rq *corev1.ResourceQuota) bool
func RemoveMigratingVM ¶
func RemoveMigratingVM(rq *corev1.ResourceQuota, vmName string)
func UpdateMigratingVM ¶
func UpdateMigratingVM(rq *corev1.ResourceQuota, vmName string, rl corev1.ResourceList) error
Types ¶
type Calculator ¶
type Calculator struct {
// contains filtered or unexported fields
}
func NewCalculator ¶
func NewCalculator( nsCache ctlv1.NamespaceCache, podCache ctlv1.PodCache, rqCache ctlharvestercorev1.ResourceQuotaCache, vmimCache ctlkubevirtv1.VirtualMachineInstanceMigrationCache) *Calculator
func (*Calculator) CheckIfVMCanStartByResourceQuota ¶
func (c *Calculator) CheckIfVMCanStartByResourceQuota(vm *kubevirtv1.VirtualMachine) error
CheckIfVMCanStartByResourceQuota checks if the VM can be started based on the resource quota limits
func (*Calculator) CheckStorageResourceQuota ¶
func (c *Calculator) CheckStorageResourceQuota(vm *kubevirtv1.VirtualMachine, oldVM *kubevirtv1.VirtualMachine) error
func (*Calculator) VMPodsExist ¶
func (c *Calculator) VMPodsExist(namespace, vmName string) (bool, error)
VMPodsExist checks if the VM pod exists
type InsufficientResourceError ¶
type InsufficientResourceError struct {
// contains filtered or unexported fields
}
func (*InsufficientResourceError) Error ¶
func (e *InsufficientResourceError) Error() string
Click to show internal directories.
Click to hide internal directories.