Documentation ¶
Index ¶
- func AddDefaultNetworkInterface(ctx *context.WebhookRequestContext, client client.Client, ...) bool
- func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error
- func NewMutator(client client.Client) builder.Mutator
- func ResolveImageName(ctx *context.WebhookRequestContext, c client.Client, vm *vmopv1.VirtualMachine) (bool, error)
- func SetCreatedAtAnnotations(ctx goctx.Context, vm *vmopv1.VirtualMachine)
- func SetDefaultPowerState(ctx *context.WebhookRequestContext, client client.Client, ...) bool
- func SetNextRestartTime(ctx *context.WebhookRequestContext, newVM, oldVM *vmopv1.VirtualMachine) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultNetworkInterface ¶ added in v1.8.5
func AddDefaultNetworkInterface(ctx *context.WebhookRequestContext, client client.Client, vm *vmopv1.VirtualMachine) bool
AddDefaultNetworkInterface adds default network interface to a VM if the NoNetwork annotation is not set and no NetworkInterface is specified. Return true if default NetworkInterface is added, otherwise return false.
func AddToManager ¶
func AddToManager(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager) error
AddToManager adds the webhook to the provided manager.
func NewMutator ¶
NewMutator returns the package's Mutator.
func ResolveImageName ¶ added in v1.8.5
func ResolveImageName( ctx *context.WebhookRequestContext, c client.Client, vm *vmopv1.VirtualMachine) (bool, error)
ResolveImageName mutates the vm.spec.imageName if it's not set to a vmi name and there is a single namespace or cluster scope image with that status name.
func SetCreatedAtAnnotations ¶ added in v1.8.6
func SetCreatedAtAnnotations(ctx goctx.Context, vm *vmopv1.VirtualMachine)
func SetDefaultPowerState ¶ added in v1.8.5
func SetDefaultPowerState( ctx *context.WebhookRequestContext, client client.Client, vm *vmopv1.VirtualMachine) bool
SetDefaultPowerState sets the default power state for a new VM. Return true if the default power state was set, otherwise false.
func SetNextRestartTime ¶
func SetNextRestartTime( ctx *context.WebhookRequestContext, newVM, oldVM *vmopv1.VirtualMachine) (bool, error)
SetNextRestartTime sets spec.nextRestartTime for a VM if the field's current value is equal to "now" (case-insensitive). Return true if set, otherwise false.
Types ¶
This section is empty.