instance

package
v2.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 39 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 CloneOrRename

func CloneOrRename(ctx context.Context, oldInst *limatype.Instance, newInstName string, rename bool) (*limatype.Instance, error)

func Create

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

func Delete

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

func LimactlShellCmd

func LimactlShellCmd(instName string) string

func Restart

func Restart(ctx context.Context, inst *limatype.Instance, showProgress bool) error

func RestartForcibly

func RestartForcibly(ctx context.Context, inst *limatype.Instance, showProgress bool) error

func ShowMessage

func ShowMessage(inst *limatype.Instance) error

func Start

func Start(ctx context.Context, inst *limatype.Instance, launchHostAgentForeground, showProgress bool) error

func StartWithPaths

func StartWithPaths(ctx context.Context, inst *limatype.Instance, launchHostAgentForeground, showProgress bool, limactl, guestAgent string) error

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

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.

The showProgress argument tells the hostagent to show provision script progress by tailing cloud-init logs.

The limactl argument allows the caller to specify the full path of the limactl executable. The guestAgent argument allows the caller to specify the full path of the guest agent executable. Inside limactl this function is only called by Start, which passes empty strings for both limactl and guestAgent, in which case the location of the current executable is used for limactl and the guest agent is located from the corresponding <prefix>/share/lima directory.

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

func StopForcibly

func StopForcibly(inst *limatype.Instance)

func StopGracefully

func StopGracefully(ctx context.Context, inst *limatype.Instance, isRestart bool) 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
	GuestAgent          string
	NerdctlArchiveCache string
}

func Prepare

func Prepare(ctx context.Context, inst *limatype.Instance, guestAgent string) (*Prepared, error)

Prepare ensures the disk, the nerdctl archive, etc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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