ociclient

package
v0.1.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnikernelTypeAnnotation    = "com.urunc.unikernel.unikernelType"
	HypervisorAnnotation       = "com.urunc.unikernel.hypervisor"
	CmdlineAnnotation          = "com.urunc.unikernel.cmdline"
	UnikernelBinaryAnnotation  = "com.urunc.unikernel.binary"
	InitrdAnnotation           = "com.urunc.unikernel.initrd"
	UnikernelVersionAnnotation = "com.urunc.unikernel.version"
)

Annotation keys for urunc unikernel configuration (from pkg/unikontainers/config.go)

View Source
const DefaultPlatform = "linux/arm64"

DefaultPlatform is the pull platform when the caller does not ask for one: native arm64, the right answer for everything except the Rosetta path (an amd64 rootfs translated under an arm64 kernel).

Variables

This section is empty.

Functions

func GuestAttr

func GuestAttr(_ string, _ bool) (mode, uid, gid uint32, ok bool)

func UnpackLayers

func UnpackLayers(layers []v1.Layer, rootfsDir string, p *Progress) error

UnpackLayers extracts all OCI image layers to the rootfs directory. p may be nil, in which case nothing is reported.

Types

type Client

type Client struct {

	// Quiet suppresses pull progress output on stderr.
	Quiet bool
	// contains filtered or unexported fields
}

Client provides OCI image operations

func New

func New(s *store.Store) *Client

New creates a new OCI client

func (*Client) GenerateBundle

func (c *Client) GenerateBundle(bundleDir, imageDigest string, imgConfig *v1.ConfigFile) error

GenerateBundle creates an OCI runtime bundle (config.json + rootfs symlink) in the bundle directory

func (*Client) ImageExists

func (c *Client) ImageExists(digest string) bool

ImageExists reports whether an image is cached AND usable. Metadata on its own does not count: see store.ImageComplete.

func (*Client) LoadImageConfig

func (c *Client) LoadImageConfig(imageDigest string) (*v1.ConfigFile, error)

LoadImageConfig loads the OCI image config from a stored image

func (*Client) Pull

func (c *Client) Pull(ctx context.Context, ref string) (*PullResult, error)

Pull fetches an OCI image from a registry and stores it locally, selecting the default (native arm64) platform.

func (*Client) PullPlatform

func (c *Client) PullPlatform(ctx context.Context, ref, platformStr string) (*PullResult, error)

PullPlatform fetches an OCI image for an explicit platform. The store is digest-keyed, so different platform variants of the same tag coexist.

type Progress

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

Progress reports how far a pull has got. The zero value is unusable; call newProgress. A nil *Progress is safe and reports nothing, so callers that do not want output (tests, library use) can pass nil.

type PullResult

type PullResult struct {
	Digest    string
	Size      int64
	Labels    map[string]string
	Platforms []string
}

PullResult contains the result of a successful image pull

Jump to

Keyboard shortcuts

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