importer

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FormatDockerArchive = "docker-archive"
	FormatOCIArchive    = "oci-archive"
	FormatDir           = "dir"
)

Output format identifiers accepted by Options.OutputFormat.

Variables

This section is empty.

Functions

func Import

func Import(ctx context.Context, opts Options) error

Import performs the full import pipeline described in spec §8.

Types

type CompositeSource

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

CompositeSource implements types.ImageSource by overlaying a delta source on top of a baseline source. GetManifest comes from the delta (the authoritative holder of the target manifest). GetBlob prefers the delta and falls back to baseline when the delta returns a not-found error.

func NewCompositeSource

func NewCompositeSource(delta, baseline types.ImageSource) *CompositeSource

NewCompositeSource wraps the two inner sources. Close() on the composite calls Close on both; the caller must not close the inner sources directly.

func (*CompositeSource) Close

func (c *CompositeSource) Close() error

func (*CompositeSource) GetBlob

func (c *CompositeSource) GetBlob(
	ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache,
) (io.ReadCloser, int64, error)

GetBlob serves delta blobs first, then baseline. Any error from the delta that is not "not found" propagates verbatim.

func (*CompositeSource) GetManifest

func (c *CompositeSource) GetManifest(ctx context.Context, instanceDigest *digest.Digest) ([]byte, string, error)

GetManifest delegates to the delta (the authoritative holder of the target manifest in the import pipeline).

func (*CompositeSource) GetSignatures

func (c *CompositeSource) GetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error)

func (*CompositeSource) HasThreadSafeGetBlob

func (c *CompositeSource) HasThreadSafeGetBlob() bool

func (*CompositeSource) LayerInfosForCopy

func (c *CompositeSource) LayerInfosForCopy(
	ctx context.Context, instanceDigest *digest.Digest,
) ([]types.BlobInfo, error)

func (*CompositeSource) Reference

func (c *CompositeSource) Reference() types.ImageReference

type DryRunReport

type DryRunReport struct {
	AllReachable   bool
	MissingDigests []string
	RequiredBlobs  int
	BaselineSource string
}

DryRunReport summarizes a dry-run import: which required baseline blobs are reachable and which (if any) are missing.

func DryRun

func DryRun(ctx context.Context, opts Options) (DryRunReport, error)

DryRun performs steps 1-4 of the import pipeline (extract, parse, open baseline, probe) without calling copy.Image or writing any output files. Returns a report describing whether every required baseline blob is reachable from the provided baseline reference.

type Options

type Options struct {
	DeltaPath    string
	BaselineRef  types.ImageReference
	OutputPath   string
	OutputFormat string // one of FormatDockerArchive, FormatOCIArchive, FormatDir
}

Options carries all inputs to Import.

Jump to

Keyboard shortcuts

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