bundle

package
v0.0.0-...-6b2d232 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package bundle implements some helper functions for firecracker-containerd's interaction with bundle dirs, both inside the VM and outside on the host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir string

Dir represents the root of a container bundle dir. It's just a type wrapper around a string, where the string is the path of the bundle dir.

func VMBundleDir

func VMBundleDir(taskID string) Dir

VMBundleDir returns the directory inside a VM at which the bundle directory for the provided taskID should exist.

func (Dir) AddrFilePath

func (d Dir) AddrFilePath() string

AddrFilePath is the path to the address file as found in the bundleDir. Even though the shim address is set per-VM, not per-container, containerd expects to find the shim addr file in the bundle dir, so we still have to create it or symlink it to the shimAddrFilePath

func (Dir) LogFifoPath

func (d Dir) LogFifoPath() string

LogFifoPath is a path to a FIFO for writing shim logs as found in the bundleDir. It is the path created by containerd for us, the shimLogFifoPath is just a symlink to one.

func (Dir) OCIConfig

func (d Dir) OCIConfig() *OCIConfig

OCIConfig returns a OCIConfig object wrapper around the bundle config.json

func (Dir) OCIConfigPath

func (d Dir) OCIConfigPath() string

OCIConfigPath returns the path to the bundle's config.json

func (Dir) RootPath

func (d Dir) RootPath() string

RootPath returns the top-level directory of the bundle dir

func (Dir) RootfsPath

func (d Dir) RootfsPath() string

RootfsPath returns the path to the "rootfs" dir of the bundle

type OCIConfig

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

OCIConfig is wrapper around a bundle's config.json that provided basic file operations on it with appropriate permissions.

func (*OCIConfig) Bytes

func (c *OCIConfig) Bytes() ([]byte, error)

Bytes returns the bytes of config.json

func (*OCIConfig) File

func (c *OCIConfig) File() (*os.File, error)

File opens the config.json as read-only

func (*OCIConfig) VMID

func (c *OCIConfig) VMID() (string, error)

VMID returns the firecracker VM ID set by the client in the OCI config Annotations section, if any.

func (*OCIConfig) Write

func (c *OCIConfig) Write(contents []byte) error

Write will create or overwrite the config.json with the provided bytes

Jump to

Keyboard shortcuts

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