mirror

package
v0.0.0-...-fc78dae Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package mirror defines commands for performing mirror operations for OCI objects and bottles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	*actions.DataTool

	Insecure  bool // allow insecure registry access
	Recursive bool // also copy referrer recursively
}

Action represents a general mirror action.

type Archive

type Archive struct {
	*Action

	// Only archive the images filtered by labels in annotations
	Selectors []string

	// Checkpoint is the path to save the checkpoint file
	Checkpoint string

	// ExistingCheckpoints is a slice of existing checkpoint files in the case of multiple failures
	ExistingCheckpoints []mirror.ResumeFromLedger

	// IndexFallback is set when the target registry does not support index-of-index behavior.
	// It will push the nested index to the target repository and add its reference to the annotations of the main gather index.
	IndexFallback bool

	// ExtraAnnotations defines the user-created annotations to add to the index of the gather repository.
	ExtraAnnotations map[string]string

	// Platforms defines the platform(s) for the images to be gathered. (Default behavior is to gather all available platforms.)
	Platforms []string
}

Archive represents the mirror clone action.

func (*Archive) Run

func (action *Archive) Run(ctx context.Context, sourceFile, destFile, reference string, existingImages []string, n, bs, hwm int) error

Run executes the actual archive operation.

type Clone

type Clone struct {
	*Action

	// Display repository manifest destinations, but do not push
	Check bool

	// Scatter images filtered by labels in annotations
	Selectors []string

	// Platforms defines the platform(s) for the images to be gathered. (Default behavior is to gather all available platforms.)
	Platforms []string
}

Clone represents the mirror clone action.

func (*Clone) Run

func (action *Clone) Run(ctx context.Context, sourceFile, mappingSpec string) error

Run runs the mirror clone action.

type Deserialize

type Deserialize struct {
	*Action

	// Strict ensures that the order of files is correct in the tar stream.
	Strict bool

	// DryRun indicates that data is not to be sent to target registry (data will be discarded instead).
	DryRun bool

	// BufferSize defines the number of bytes to use for the the buffer for reading from the archive (tape)
	BufferSize int
}

Deserialize represents the mirror serialize action.

func (*Deserialize) Run

func (action *Deserialize) Run(ctx context.Context, sourceFile string, dest string) error

Run runs the mirror deserialize action.

type Gather

type Gather struct {
	*Action

	// IndexFallback is set when the target registry does not support index-of-index behavior.
	// It will push the nested index to the target repository and add its reference to the annotations of the main gather index.
	IndexFallback bool

	// ExtraAnnotations defines the user-created annotations to add to the index of the gather repository.
	ExtraAnnotations map[string]string

	// Platforms defines the platform(s) for the images to be gathered. (Default behavior is to gather all available platforms.)
	Platforms []string
}

Gather represents the mirror gather action.

func (*Gather) Run

func (action *Gather) Run(ctx context.Context, sourceFile string, dest string) error

Run executes the actual gather operation.

type Scatter

type Scatter struct {
	*Action

	Check      bool     // Display repository manifest destinations, but do not push
	SourceFile string   // The optional sources.list can be passed to scatter a subset of the images from the source repository (i.e., not all of the images in the source repository).
	Selectors  []string // Scatter images filtered by labels in annotations
}

Scatter represents the mirror scatter action.

func (*Scatter) Run

func (action *Scatter) Run(ctx context.Context, sourceRepo, mappingSpec string) error

Run runs the mirror scatter action.

type Serialize

type Serialize struct {
	*Action

	Checkpoint          string                    // path to save the checkpoint file
	ExistingCheckpoints []mirror.ResumeFromLedger // a slice of existing checkpoint files in the case of multiple failures
}

Serialize represents the mirror serialize action.

func (*Serialize) Run

func (action *Serialize) Run(ctx context.Context, ref string, destFile string, existingImages []string, n, bs, hwm int) error

Run runs the mirror serialize action.

type Unarchive

type Unarchive struct {
	*Action

	// Strict ensures that the order of files is correct in the tar stream.
	Strict bool

	// DryRun indicates that data is not to be sent to target registry (data will be discarded instead).
	DryRun bool

	// BufferSize defines the number of bytes to use for the the buffer for reading from the archive (tape)
	BufferSize int

	// An optional sources.list can be passed to scatter a subset of the images from the source repository (i.e., not all of the images in the source repository).
	SubsetFile string

	// Scatter images filtered by labels in annotations
	Selectors []string
}

Unarchive represents the mirror unarchive action.

func (*Unarchive) Run

func (action *Unarchive) Run(ctx context.Context, sourceFile, mappingSpec, reference string) error

Run runs the mirror unarchive action.

type WorkTracker

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

WorkTracker is an object for tracking the number of blobs and bytes actually pushed.

func (*WorkTracker) Add

func (wt *WorkTracker) Add(desc ocispec.Descriptor)

Add adds the digest and blob to the work tracker count.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳