Documentation
¶
Overview ¶
Package sandbox provides the core sandbox VM management functionality.
Index ¶
- func DefaultGuestAgentPath() string
- func DefaultGuestFusedPath() string
- func DefaultInitramfsPath() string
- func DefaultKernelPath() string
- func DefaultKernelPathWithVersion(version string) (string, error)
- func ExecInteractiveViaRelay(ctx context.Context, socketPath, command, workingDir, user string, ...) (int, error)
- func ExecViaRelay(ctx context.Context, socketPath, command, workingDir, user string) (*api.ExecResult, error)
- func KernelArch() string
- func KernelVersion() string
- type ExecRelay
- type FirewallRules
- type Options
- type Sandbox
- func (s *Sandbox) CAPool() *sandboxnet.CAPool
- func (s *Sandbox) Close(ctx context.Context) error
- func (s *Sandbox) Config() *api.Config
- func (s *Sandbox) Events() <-chan api.Event
- func (s *Sandbox) Exec(ctx context.Context, command string, opts *api.ExecOptions) (*api.ExecResult, error)
- func (s *Sandbox) ID() string
- func (s *Sandbox) ListFiles(ctx context.Context, path string) ([]api.FileInfo, error)
- func (s *Sandbox) Machine() vm.Machine
- func (s *Sandbox) Policy() *policy.Engine
- func (s *Sandbox) PrepareExecEnv() *api.ExecOptions
- func (s *Sandbox) ReadFile(ctx context.Context, path string) ([]byte, error)
- func (s *Sandbox) ReadFileTo(ctx context.Context, path string, w io.Writer) (int64, error)
- func (s *Sandbox) Start(ctx context.Context) error
- func (s *Sandbox) Stop(ctx context.Context) error
- func (s *Sandbox) Workspace() string
- func (s *Sandbox) WriteFile(ctx context.Context, path string, content []byte, mode uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGuestAgentPath ¶
func DefaultGuestAgentPath() string
DefaultGuestAgentPath returns the default path to guest-agent binary.
func DefaultGuestFusedPath ¶
func DefaultGuestFusedPath() string
DefaultGuestFusedPath returns the default path to guest-fused binary.
func DefaultInitramfsPath ¶
func DefaultInitramfsPath() string
DefaultInitramfsPath returns the default path to the initramfs image (optional, mainly for macOS).
func DefaultKernelPath ¶
func DefaultKernelPath() string
DefaultKernelPath returns the path to the kernel image, downloading if needed. It checks in order: MATCHLOCK_KERNEL env, legacy paths, then downloads from OCI.
func DefaultKernelPathWithVersion ¶
DefaultKernelPathWithVersion returns the path to a specific kernel version.
func ExecInteractiveViaRelay ¶
func ExecInteractiveViaRelay(ctx context.Context, socketPath, command, workingDir, user string, rows, cols uint16, stdin io.Reader, stdout io.Writer) (int, error)
ExecInteractiveViaRelay connects to an exec relay socket and runs an interactive command.
func ExecViaRelay ¶
func ExecViaRelay(ctx context.Context, socketPath, command, workingDir, user string) (*api.ExecResult, error)
ExecViaRelay connects to an exec relay socket and runs a command.
Types ¶
type ExecRelay ¶
type ExecRelay struct {
// contains filtered or unexported fields
}
ExecRelay serves exec requests from external processes via a Unix socket. This allows `matchlock exec` to run commands in a VM owned by another process.
func NewExecRelay ¶
type FirewallRules ¶
FirewallRules is an interface for managing firewall rules.
type Options ¶
type Options struct {
// KernelPath overrides the default kernel path
KernelPath string
// RootfsPath is the path to the rootfs image (required)
RootfsPath string
}
Options configures sandbox creation.
type Sandbox ¶
type Sandbox struct {
// contains filtered or unexported fields
}
Sandbox represents a running sandbox VM with all associated resources.
func (*Sandbox) CAPool ¶ added in v0.1.1
func (s *Sandbox) CAPool() *sandboxnet.CAPool
func (*Sandbox) Exec ¶
func (s *Sandbox) Exec(ctx context.Context, command string, opts *api.ExecOptions) (*api.ExecResult, error)
func (*Sandbox) PrepareExecEnv ¶ added in v0.1.1
func (s *Sandbox) PrepareExecEnv() *api.ExecOptions