pool_manager

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RangeStartEnv              = "RANGE_START"
	RangeEndEnv                = "RANGE_END"
	RuntimeObjectFinalizerName = "k8s.v1.cni.cncf.io/kubeMacPool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationStatus

type AllocationStatus string
const (
	AllocationStatusAllocated     AllocationStatus = "Allocated"
	AllocationStatusWaitingForPod AllocationStatus = "WaitingForPod"
)

type PoolManager

type PoolManager struct {
	// contains filtered or unexported fields
}

func NewPoolManager

func NewPoolManager(kubeClient kubernetes.Interface, rangeStart, rangeEnd net.HardwareAddr, managerNamespace string, kubevirtExist bool, waitTime int) (*PoolManager, error)

func (*PoolManager) AddMacToWaitingConfig

func (p *PoolManager) AddMacToWaitingConfig(allocations map[string]string) error

Add all the allocated mac addresses to the waiting config map with the current time.

func (*PoolManager) AllocatePodMac

func (p *PoolManager) AllocatePodMac(pod *corev1.Pod) error

func (*PoolManager) AllocateVirtualMachineMac

func (p *PoolManager) AllocateVirtualMachineMac(virtualMachine *kubevirt.VirtualMachine) error

func (*PoolManager) InitMaps

func (p *PoolManager) InitMaps() error

func (*PoolManager) IsKubevirtEnabled

func (p *PoolManager) IsKubevirtEnabled() bool

func (*PoolManager) MarkVMAsReady

func (p *PoolManager) MarkVMAsReady(vm *kubevirt.VirtualMachine) error

Remove all the mac addresses from the waiting configmap this mean the vm was saved in the etcd and pass validations

func (*PoolManager) ReleasePodMac

func (p *PoolManager) ReleasePodMac(podName string) error

func (*PoolManager) ReleaseVirtualMachineMac

func (p *PoolManager) ReleaseVirtualMachineMac(vm *kubevirt.VirtualMachine) error

func (*PoolManager) UpdateMacAddressesForVirtualMachine

func (p *PoolManager) UpdateMacAddressesForVirtualMachine(previousVirtualMachine, virtualMachine *kubevirt.VirtualMachine) error

Jump to

Keyboard shortcuts

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