Documentation ¶
Index ¶
- Constants
- func CreateTransactionTimestamp() time.Time
- func GetMacPoolSize(rangeStart, rangeEnd net.HardwareAddr) (int64, error)
- func GetTransactionTimestampAnnotationFromVm(virtualMachine *kubevirt.VirtualMachine) (time.Time, error)
- func IsVirtualMachineDeletionInProgress(vm *kubevirt.VirtualMachine) bool
- func SetTransactionTimestampAnnotationToVm(virtualMachine *kubevirt.VirtualMachine, transactionTimestamp time.Time)
- func VmNamespaced(machine *kubevirt.VirtualMachine) string
- func VmNamespacedFromRequest(request *reconcile.Request) string
- type OptMode
- type PoolManager
- func (p *PoolManager) AllocatePodMac(pod *corev1.Pod, isNotDryRun bool) error
- func (p *PoolManager) AllocateVirtualMachineMac(virtualMachine *kubevirt.VirtualMachine, transactionTimestamp *time.Time, ...) error
- func (p *PoolManager) InitMaps() error
- func (p *PoolManager) IsKubevirtEnabled() bool
- func (p *PoolManager) IsNamespaceManaged(namespaceName, webhookName string) (bool, error)
- func (p *PoolManager) IsPodManaged(namespaceName string) (bool, error)
- func (p *PoolManager) IsVirtualMachineManaged(namespaceName string) (bool, error)
- func (p *PoolManager) MarkVMAsReady(vm *kubevirt.VirtualMachine, latestPersistedTransactionTimeStamp *time.Time, ...) error
- func (p *PoolManager) ReleaseAllPodMacs(podFullName string) error
- func (p *PoolManager) ReleaseAllVirtualMachineMacs(vmFullName string, parentLogger logr.Logger) error
- func (p *PoolManager) Start() error
- func (p *PoolManager) UpdateMacAddressesForVirtualMachine(previousVirtualMachine, virtualMachine *kubevirt.VirtualMachine, ...) error
Constants ¶
View Source
const ( RangeStartEnv = "RANGE_START" RangeEndEnv = "RANGE_END" RuntimeObjectFinalizerName = "k8s.v1.cni.cncf.io/kubeMacPool" NetworksAnnotation = "k8s.v1.cni.cncf.io/networks" TransactionTimestampAnnotation = "kubemacpool.io/transaction-timestamp" )
Variables ¶
This section is empty.
Functions ¶
func CreateTransactionTimestamp ¶ added in v0.23.0
func GetMacPoolSize ¶ added in v0.15.0
func GetMacPoolSize(rangeStart, rangeEnd net.HardwareAddr) (int64, error)
func GetTransactionTimestampAnnotationFromVm ¶ added in v0.23.0
func GetTransactionTimestampAnnotationFromVm(virtualMachine *kubevirt.VirtualMachine) (time.Time, error)
func IsVirtualMachineDeletionInProgress ¶ added in v0.23.0
func IsVirtualMachineDeletionInProgress(vm *kubevirt.VirtualMachine) bool
func SetTransactionTimestampAnnotationToVm ¶ added in v0.23.0
func SetTransactionTimestampAnnotationToVm(virtualMachine *kubevirt.VirtualMachine, transactionTimestamp time.Time)
func VmNamespaced ¶ added in v0.23.0
func VmNamespaced(machine *kubevirt.VirtualMachine) string
func VmNamespacedFromRequest ¶ added in v0.30.0
Types ¶
type PoolManager ¶
type PoolManager struct {
// contains filtered or unexported fields
}
func NewPoolManager ¶
func NewPoolManager(kubeClient, cachedKubeClient client.Client, rangeStart, rangeEnd net.HardwareAddr, managerNamespace string, kubevirtExist bool, waitTime int) (*PoolManager, error)
func (*PoolManager) AllocatePodMac ¶
func (p *PoolManager) AllocatePodMac(pod *corev1.Pod, isNotDryRun bool) error
func (*PoolManager) AllocateVirtualMachineMac ¶
func (p *PoolManager) AllocateVirtualMachineMac(virtualMachine *kubevirt.VirtualMachine, transactionTimestamp *time.Time, isNotDryRun bool, parentLogger logr.Logger) error
func (*PoolManager) InitMaps ¶
func (p *PoolManager) InitMaps() error
func (*PoolManager) IsKubevirtEnabled ¶
func (p *PoolManager) IsKubevirtEnabled() bool
func (*PoolManager) IsNamespaceManaged ¶ added in v0.22.0
func (p *PoolManager) IsNamespaceManaged(namespaceName, webhookName string) (bool, error)
IsNamespaceManaged checks if the namespace of the instance is managed by kubemacpool in terms of opt-mode
func (*PoolManager) IsPodManaged ¶ added in v0.23.0
func (p *PoolManager) IsPodManaged(namespaceName string) (bool, error)
IsPodManaged checks if the namespace of a pod instance is opted in for kubemacpool
func (*PoolManager) IsVirtualMachineManaged ¶ added in v0.23.0
func (p *PoolManager) IsVirtualMachineManaged(namespaceName string) (bool, error)
IsVirtualMachineManaged checks if the namespace of a VirtualMachine instance is managed by kubemacpool
func (*PoolManager) MarkVMAsReady ¶ added in v0.5.0
func (p *PoolManager) MarkVMAsReady(vm *kubevirt.VirtualMachine, latestPersistedTransactionTimeStamp *time.Time, parentLogger logr.Logger) error
Remove all the mac addresses from the waiting configmap this mean the vm was saved in the etcd and pass validations
func (*PoolManager) ReleaseAllPodMacs ¶ added in v0.23.0
func (p *PoolManager) ReleaseAllPodMacs(podFullName string) error
func (*PoolManager) ReleaseAllVirtualMachineMacs ¶ added in v0.23.0
func (p *PoolManager) ReleaseAllVirtualMachineMacs(vmFullName string, parentLogger logr.Logger) error
func (*PoolManager) Start ¶ added in v0.14.3
func (p *PoolManager) Start() error
func (*PoolManager) UpdateMacAddressesForVirtualMachine ¶ added in v0.5.0
func (p *PoolManager) UpdateMacAddressesForVirtualMachine(previousVirtualMachine, virtualMachine *kubevirt.VirtualMachine, transactionTimestamp *time.Time, isNotDryRun bool, parentLogger logr.Logger) error
Click to show internal directories.
Click to hide internal directories.