Documentation ¶
Index ¶
- Constants
- func Register(ctx context.Context, management *config.Management, options config.Options) error
- type VMController
- func (h *VMController) OnVMRemove(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
- func (h *VMController) SetOwnerOfPVCs(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
- func (h *VMController) StoreRunStrategy(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
- func (h *VMController) SyncLabelsToVmi(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
- type VMIController
- type VMNetworkController
Constants ¶
const (
VirtualMachineCreatorNodeDriver = "docker-machine-driver-harvester"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type VMController ¶
type VMController struct {
// contains filtered or unexported fields
}
func (*VMController) OnVMRemove ¶ added in v1.1.0
func (h *VMController) OnVMRemove(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
OnVMRemove handle related PVC and delete related VMBackup snapshot
func (*VMController) SetOwnerOfPVCs ¶ added in v0.3.0
func (h *VMController) SetOwnerOfPVCs(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
SetOwnerOfPVCs records the target VirtualMachine as the owner of the PVCs in annotation.
func (*VMController) StoreRunStrategy ¶ added in v1.0.2
func (h *VMController) StoreRunStrategy(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
StoreRunStrategy stores the last running strategy into the annotation before the VM is stopped. As a workaround for the issue https://github.com/kubevirt/kubevirt/issues/7295
func (*VMController) SyncLabelsToVmi ¶ added in v1.1.0
func (h *VMController) SyncLabelsToVmi(_ string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
SyncLabelsToVmi synchronizes the labels in the VM spec to the existing VMI without re-deployment
type VMIController ¶
type VMIController struct {
// contains filtered or unexported fields
}
func (*VMIController) ReconcileFromHostLabels ¶ added in v1.0.3
func (h *VMIController) ReconcileFromHostLabels(_ string, vmi *kubevirtv1.VirtualMachineInstance) (*kubevirtv1.VirtualMachineInstance, error)
ReconcileFromHostLabels handles the propagation of metadata from node labels to VirtualMachineInstance annotations.
func (*VMIController) UnsetOwnerOfPVCs ¶ added in v0.3.0
func (h *VMIController) UnsetOwnerOfPVCs(_ string, vmi *kubevirtv1.VirtualMachineInstance) (*kubevirtv1.VirtualMachineInstance, error)
UnsetOwnerOfPVCs erases the target VirtualMachine from the owner of the PVCs in annotation.
When modifying the VirtualMachine's spec to remove the previously defined PVCs and recreating the VirtualMachineInstance, those previously defined PVCs still hold an OwnerReference of the VirtualMachine, but they are no longer used by the newly created VirtualMachineInstance.
Since the handler of VMController has recorded the relationship in the PVC's annotation, this handler will erase the target owner from the PVC's annotation to avoid logic leak.
type VMNetworkController ¶
type VMNetworkController struct {
// contains filtered or unexported fields
}
func (*VMNetworkController) SetDefaultNetworkMacAddress ¶
func (h *VMNetworkController) SetDefaultNetworkMacAddress(id string, vmi *kubevirtv1.VirtualMachineInstance) (*kubevirtv1.VirtualMachineInstance, error)
SetDefaultNetworkMacAddress set the default mac address of networks using the initial allocated mac address from the VMI status, since the most guest OS will use the initial allocated mac address of its DHCP config, and on Kubevirt the VM restart it will re-allocate a new mac address which will lead the original network unreachable.