mutation

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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

func NewMutator(client client.Client) builder.Mutator

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.

Jump to

Keyboard shortcuts

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