instance

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWatchHostAgentEventsTimeout = 10 * time.Minute

DefaultWatchHostAgentEventsTimeout is the duration to wait for the instance to be running before timing out.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, instName string, instConfig []byte, saveBrokenYAML bool) (*store.Instance, error)

func Delete

func Delete(ctx context.Context, inst *store.Instance, force bool) error

func LimactlShellCmd

func LimactlShellCmd(instName string) string

func ShowMessage

func ShowMessage(inst *store.Instance) error

func Start

func Start(ctx context.Context, inst *store.Instance, limactl string, launchHostAgentForeground bool) error

Start starts the hostagent in the background, which in turn will start the instance. Start will listen to hostagent events and log them to STDOUT until either the instance is running, or has failed to start.

The `limactl` argument allows the caller to specify the full path of the `limactl` executable. When called from inside limactl itself it will always be the empty string which uses the name of the current executable instead.

The `launchHostAgentForeground` argument makes the hostagent run in the foreground. The function will continue to listen and log hostagent events until the instance is shut down again.

Start calls Prepare by itself, so you do not need to call Prepare manually before calling Start.

func StopForcibly

func StopForcibly(inst *store.Instance)

func StopGracefully

func StopGracefully(inst *store.Instance) error

func WithWatchHostAgentTimeout

func WithWatchHostAgentTimeout(ctx context.Context, timeout time.Duration) context.Context

WithWatchHostAgentTimeout sets the value of the timeout to use for watchHostAgentEvents in the given Context.

Types

type Prepared

type Prepared struct {
	Driver              driver.Driver
	NerdctlArchiveCache string
}

func Prepare

func Prepare(ctx context.Context, inst *store.Instance) (*Prepared, error)

Prepare ensures the disk, the nerdctl archive, etc.

Jump to

Keyboard shortcuts

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