oci

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	images.BaseConfig
}

func NewConfig

func NewConfig(conf *config.Config) *Config

func (*Config) BootBaseDir

func (c *Config) BootBaseDir() string

func (*Config) BootDir

func (c *Config) BootDir(layerDigestHex string) string

func (*Config) EnsureDirs

func (c *Config) EnsureDirs() error

func (*Config) InitrdPath

func (c *Config) InitrdPath(layerDigestHex string) string

func (*Config) KernelPath

func (c *Config) KernelPath(layerDigestHex string) string

type OCI

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

OCI converts OCI container layers to EROFS for Cloud Hypervisor.

func New

func New(ctx context.Context, conf *config.Config) (*OCI, error)

func (*OCI) Config

func (o *OCI) Config(ctx context.Context, vms []*types.VMConfig) (result [][]*types.StorageConfig, boot []*types.BootConfig, err error)

Config builds StorageConfig + BootConfig from layer digests; errors if any blob is missing.

func (*OCI) Delete

func (o *OCI) Delete(ctx context.Context, ids []string) ([]string, error)

Delete returns actually-deleted refs; not-found ids are logged and skipped.

func (*OCI) GCModule

func (o *OCI) GCModule() gc.Module[images.ImageGCSnapshot]

func (*OCI) Import

func (o *OCI) Import(ctx context.Context, name string, tracker progress.Tracker, file ...string) error

Import: each tar file becomes one EROFS layer in the order of the files slice.

func (*OCI) ImportFromReader added in v0.2.7

func (o *OCI) ImportFromReader(ctx context.Context, name string, tracker progress.Tracker, r io.Reader) error

func (*OCI) Inspect

func (o *OCI) Inspect(ctx context.Context, id string) (*types.Image, error)

Inspect returns (nil, nil) if not found.

func (*OCI) List

func (o *OCI) List(ctx context.Context) ([]*types.Image, error)

func (*OCI) Pull

func (o *OCI) Pull(ctx context.Context, image string, _ bool, tracker progress.Tracker) error

Pull downloads an OCI image, extracts boot files, and converts each layer to EROFS concurrently.

func (*OCI) RegisterGC

func (o *OCI) RegisterGC(orch *gc.Orchestrator)

func (*OCI) Type

func (o *OCI) Type() string

Jump to

Keyboard shortcuts

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