resourcequota

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ErrInsufficientResourcesFMT = "%s insufficient resources"
)

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 IsInsufficientResourceError

func IsInsufficientResourceError(err error) 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 (*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) 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

Jump to

Keyboard shortcuts

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