status

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package status provides utility options to manage the vmi status. This package should be used only in unit test files in which there is the need to set the status of a vmi to simulate different behaviors. BE AWARE: any usage of this package outside the unit test files or controllers is to be considered wrong since the status should only be manipulated by the controllers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New instantiates a new VMI status configuration, building its properties based on the specified With* options.

func NewVMStatus

func NewVMStatus(opts ...VMOption) v1.VirtualMachineStatus

New instantiates a new VM status configuration, building its properties based on the specified With* options.

func Update

Update updates the given VMI status configuration, adding the properties based on the specified With* options. This will directly manipulate the given VMI status. It is up to the caller to pass a copy (using DeepCopy()) if data protection is needed.

func WithStatus

func WithStatus(status v1.VirtualMachineInstanceStatus) libvmi.Option

WithStatus sets the status with specified value

func WithVMStatus

func WithVMStatus(status v1.VirtualMachineStatus) libvmi.VMOption

WithStatus sets the status with specified value

Types

type Option

type Option func(vmiStatus *v1.VirtualMachineInstanceStatus)

func WithActivePod

func WithActivePod(uid types.UID, nodeName string) Option

WithActivePod adds an active pod with the given uid and nodename

func WithCondition

func WithCondition(condition v1.VirtualMachineInstanceCondition) Option

WithCondition adds the condition to the status conditions list

func WithInterfaceStatus

func WithInterfaceStatus(interfaceStatus v1.VirtualMachineInstanceNetworkInterface) Option

WithInterfaceStatus adds an interface status

func WithLauncherContainerImageVersion

func WithLauncherContainerImageVersion(image string) Option

WithLauncherContainerImageVersion sets the status.launcherContainerImageVersion

func WithMigratedVolume

func WithMigratedVolume(volumeInfo v1.StorageMigratedVolumeInfo) Option

WithMigratedVolume adds a migrated volume

func WithMigrationState

func WithMigrationState(migrationState v1.VirtualMachineInstanceMigrationState) Option

WithMigrationState sets the migration state

func WithPhase

func WithPhase(phase v1.VirtualMachineInstancePhase) Option

WithPhase sets the vmi phase

func WithPhaseTransitionTimestamps

func WithPhaseTransitionTimestamps(ts v1.VirtualMachineInstancePhaseTransitionTimestamp) Option

WithPhaseTransitionTimestamps adds the vmi phase transition timestamp

func WithVolumeStatus

func WithVolumeStatus(volumeStatus v1.VolumeStatus) Option

WithVolumeStatus adds a volume status

type VMOption

type VMOption func(vmiStatus *v1.VirtualMachineStatus)

func WithVMCondition

func WithVMCondition(cond v1.VirtualMachineCondition) VMOption

func WithVMVolumeUpdateState

func WithVMVolumeUpdateState(volumeUpdateState *v1.VolumeUpdateState) VMOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳