Documentation
¶
Index ¶
- func IsTarFile(path string) bool
- type Config
- type OCI
- func (o *OCI) Config(ctx context.Context, vms []*types.VMConfig) (result [][]*types.StorageConfig, boot []*types.BootConfig, err error)
- func (o *OCI) Delete(ctx context.Context, ids []string) ([]string, error)
- func (o *OCI) GCModule() gc.Module[images.ImageGCSnapshot]
- func (o *OCI) Import(ctx context.Context, name string, tracker progress.Tracker, file ...string) error
- func (o *OCI) Inspect(ctx context.Context, id string) (*types.Image, error)
- func (o *OCI) List(ctx context.Context) ([]*types.Image, error)
- func (o *OCI) Pull(ctx context.Context, image string, tracker progress.Tracker) error
- func (o *OCI) RegisterGC(orch *gc.Orchestrator)
- func (o *OCI) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
images.BaseConfig
}
Config holds OCI image backend specific configuration, embedding the shared BaseConfig.
func (*Config) BootBaseDir ¶
func (*Config) EnsureDirs ¶
EnsureDirs creates all required directories for the OCI backend.
func (*Config) InitrdPath ¶
func (*Config) KernelPath ¶
type OCI ¶
type OCI struct {
// contains filtered or unexported fields
}
OCI implements the images.Images interface using OCI container images converted to EROFS filesystems for use with Cloud Hypervisor.
func (*OCI) Config ¶
func (o *OCI) Config(ctx context.Context, vms []*types.VMConfig) (result [][]*types.StorageConfig, boot []*types.BootConfig, err error)
Config generates StorageConfig and BootConfig entries for the given VMs. Paths are derived from layer digests at runtime, not stored in the index. Image references are normalized (e.g., "ubuntu:24.04" matches "docker.io/library/ubuntu:24.04"). Returns an error if any referenced blob or boot file is missing on disk.
func (*OCI) Delete ¶
Delete removes images from the index. Returns the list of actually deleted refs. Images not found are logged and skipped.
func (*OCI) GCModule ¶
func (o *OCI) GCModule() gc.Module[images.ImageGCSnapshot]
GCModule returns a typed gc.Module for the OCI backend.
func (*OCI) Import ¶
func (o *OCI) Import(ctx context.Context, name string, tracker progress.Tracker, file ...string) error
Import imports local tar files as an OCI image. Each tar file becomes one EROFS layer (ordered by the files slice).
func (*OCI) Inspect ¶
Inspect returns the record for a single image. Returns (nil, nil) if not found.
func (*OCI) Pull ¶
Pull downloads an OCI image from a container registry, extracts boot files (kernel, initrd), and converts each layer to EROFS concurrently.
func (*OCI) RegisterGC ¶
func (o *OCI) RegisterGC(orch *gc.Orchestrator)
RegisterGC registers the OCI GC module with the given Orchestrator.