ocisif

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (ocibundle.Bundle, error)

New returns a bundle interface to create/delete an OCI bundle from an oci-sif image ref.

Types

type Bundle

type Bundle struct {

	// Generic bundle properties
	ocibundle.Bundle
	// contains filtered or unexported fields
}

Bundle is a native OCI bundle, created from imageRef.

func (*Bundle) Create

func (b *Bundle) Create(ctx context.Context, ociConfig *specs.Spec) error

Create sets up the on-disk structure for an OCI runtime bundle, with rootfs mounted from the associated oci-sif image.

func (*Bundle) Delete

func (b *Bundle) Delete(ctx context.Context) error

Delete erases OCI bundle created an OCI image ref

func (*Bundle) ImageSpec

func (b *Bundle) ImageSpec() (imgSpec *imgspecv1.Image)

ImageSpec returns the OCI image spec associated with the bundle.

func (*Bundle) Path

func (b *Bundle) Path() string

Path returns the bundle's path on disk.

func (*Bundle) Update

func (b *Bundle) Update(_ context.Context, ociConfig *specs.Spec) error

Update will update the OCI config for the OCI bundle, so that it is ready for execution.

type Option

type Option func(b *Bundle) error

func OptBundlePath

func OptBundlePath(bp string) Option

OptBundlePath sets the path that the bundle will be created at.

func OptImageRef

func OptImageRef(ref string) Option

OptImageRef sets the image source reference, from which the bundle will be created.

type UnavailableError

type UnavailableError struct {
	Underlying error
}

UnavailableError is used to wrap an Underlying error, while indicating that it is not currently possible to setup an OCI bundle using direct mount(s) from an OCI-SIF. This is intended to permit fall-back paths in the caller when squashfuse is unavailable / failing.

TODO - replace with native Go error wrapping at major version increment.

func (UnavailableError) Error

func (e UnavailableError) Error() string

Jump to

Keyboard shortcuts

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