tools

package
v4.1.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RunScript = "/.singularity.d/actions/run"

RunScript is the default process argument

Variables

This section is empty.

Functions

func BundleUser

func BundleUser(bundlePath, user string) (u *user.User, err error)

BundleUser returns a user struct for the specified user, from the bundle passwd file.

func CreateLoop

func CreateLoop(file *os.File, offset, size uint64) (string, io.Closer, error)

CreateLoop associates a file to loop device and returns path of loop device used and a closer to close the loop device

func CreateOverlay

func CreateOverlay(ctx context.Context, bundlePath string) error

CreateOverlay creates a writable overlay using a directory inside the OCI bundle.

func CreateOverlayTmpfs

func CreateOverlayTmpfs(ctx context.Context, bundlePath string, sizeMiB int, allowSetuid bool) (string, error)

CreateOverlay creates a writable overlay using tmpfs, mounting it over the bundle rootfs.

func DeleteBundle

func DeleteBundle(bundlePath string) error

DeleteBundle deletes bundle directory

func DeleteOverlay

func DeleteOverlay(ctx context.Context, bundlePath string) error

DeleteOverlay deletes an overlay previously created using a directory inside the OCI bundle.

func DeleteOverlayTmpfs

func DeleteOverlayTmpfs(ctx context.Context, bundlePath, olDir string) error

DeleteOverlayTmpfs unmounts and deletes a tmpfs backed overlay created with CreateOverlayTmpfs.

func GenerateBundleConfig

func GenerateBundleConfig(bundlePath string, config *specs.Spec) (*generate.Generator, error)

GenerateBundleConfig generates a minimal OCI bundle directory with the provided OCI configuration or a default one if there is no configuration

func PrepareOverlayTmpfs added in v4.1.0

func PrepareOverlayTmpfs(bundlePath string, sizeMiB int, allowSetuid bool) (string, error)

PrepareOverlayTmpfs creates a tmpfs, mounted to the overlay/ directory in the bundle, but does not perform an overlay mount using it.

func SaveBundleConfig

func SaveBundleConfig(bundlePath string, g *generate.Generator) error

SaveBundleConfig creates config.json in OCI bundle directory and saves OCI configuration

Types

type Config

type Config string

Config provides functions for accessing the runtime configuration (JSON) of a bundle. It is initialized with the path of the bundle.

func (Config) Path

func (c Config) Path() string

Path returns the path to the runtime configuration (JSON) of a bundle.

type Layers added in v4.1.0

type Layers string

Layers provides functions for accessing the layers directory of a bundle, which will hold any image layer directories that are created. It is initialized with the path of the bundle.

func (Layers) Path added in v4.1.0

func (l Layers) Path() string

Path returns the path of the layers directory in the bundle, in which any image layer directories should be created.

type RootFs

type RootFs string

RootFs provides functions for accessing the rootfs directory of a bundle. It is initialized with the path of the bundle.

func (RootFs) Path

func (r RootFs) Path() string

Path returns the rootfs path inside the bundle.

type Volumes

type Volumes string

Volumes provides functions for accessing the volumes directory of a bundle, which will hold any volume directories that are created. It is initialized with the path of the bundle.

func (Volumes) Path

func (v Volumes) Path() string

Path returns the path of the volumes directory in the bundle, in which any volumes should be created.

Jump to

Keyboard shortcuts

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