resource

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MacOSRuntime is the runtime name for macOS virtual machines.
	MacOSRuntime = "vz"

	// ContainerRuntime is the runtime name for containerized workloads.
	ContainerRuntime = "docker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	ID    string
	Name  string
	State ContainerState
}

Container represents a single container with its ID, name, and state.

type ContainerState

type ContainerState struct {
	Status     ContainerStatus
	StartedAt  time.Time
	FinishedAt time.Time
	ExitCode   int
	Error      string
}

ContainerState holds information about the current and past state of a container.

type ContainerStatus

type ContainerStatus int

ContainerStatus represents the status of a container.

const (
	// Container is waiting to be created.
	ContainerStatusWaiting ContainerStatus = iota

	// Container has been created
	ContainerStatusCreated

	// Container is currently running
	ContainerStatusRunning

	// Container has been paused
	ContainerStatusPaused

	// Container is in the process of restarting.
	ContainerStatusRestarting

	// Container was killed due to an out-of-memory condition.
	ContainerStatusOOMKilled

	// Container has terminated.
	ContainerStatusDead

	// Container status is unknown.
	ContainerStatusUnknown
)

type ExecAction

type ExecAction struct {
	// Command is the command line to execute inside the container.
	// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
	Command []string

	// TimeoutDuration is the maximum duration to wait for the command to complete.
	TimeoutDuration time.Duration
}

type MacOSVirtualMachine

type MacOSVirtualMachine struct {
	// contains filtered or unexported fields
}

MacOSVirtualMachine represents a macOS virtual machine instance along with its error state.

func NewMacOSVirtualMachine

func NewMacOSVirtualMachine(env []corev1.EnvVar) MacOSVirtualMachine

NewMacOSVirtualMachine creates a new instance of MacOSVirtualMachine.

func (*MacOSVirtualMachine) Env

func (m *MacOSVirtualMachine) Env() []corev1.EnvVar

Environment returns the environment variables for the macOS virtual machine.

func (*MacOSVirtualMachine) Error

func (m *MacOSVirtualMachine) Error() error

Error returns the error state of the macOS virtual machine.

func (*MacOSVirtualMachine) FinishedAt

func (m *MacOSVirtualMachine) FinishedAt() *time.Time

FinishedAt returns the finish time of the macOS virtual machine.

func (*MacOSVirtualMachine) IPAddress

func (m *MacOSVirtualMachine) IPAddress() string

IPAddress returns the IP address of the macOS virtual machine.

func (*MacOSVirtualMachine) Instance

Instance returns the internal VirtualMachineInstance.

func (*MacOSVirtualMachine) SetError

func (m *MacOSVirtualMachine) SetError(err error)

SetError sets the error state of the macOS virtual machine.

func (*MacOSVirtualMachine) SetInstance

func (m *MacOSVirtualMachine) SetInstance(instance *vm.VirtualMachineInstance)

SetInstance sets the internal VirtualMachineInstance.

func (*MacOSVirtualMachine) StartedAt

func (m *MacOSVirtualMachine) StartedAt() *time.Time

StartedAt returns the start time of the macOS virtual machine.

func (*MacOSVirtualMachine) State

State returns the current state of the macOS virtual machine.

type VirtualMachine

type VirtualMachine interface {
	// Env returns the environment variables for the virtual machine.
	Env() []corev1.EnvVar

	// State returns the current state of the virtual machine.
	State() VirtualMachineState

	// Error returns the error state of the virtual machine.
	Error() error

	// SetError sets the error state of the virtual machine.
	SetError(err error)

	// IPAddress returns the IP address of the virtual machine.
	IPAddress() string

	// StartedAt returns the start time of the virtual machine.
	StartedAt() *time.Time

	// FinishedAt returns the finish time of the virtual machine.
	FinishedAt() *time.Time
}

type VirtualMachineState

type VirtualMachineState int

VirtualMachineState represents the state of a macOS virtual machine.

const (
	// VM is preparing.
	VirtualMachineStatePreparing VirtualMachineState = iota

	// VM is starting.
	VirtualMachineStateStarting

	// VM is running.
	VirtualMachineStateRunning

	// VM is terminating.
	VirtualMachineStateTerminating

	// VM has terminated.
	VirtualMachineStateTerminated

	// VM has failed.
	VirtualMachineStateFailed
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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