rootfs

package
v1.4.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyLayer

func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts ...snapshots.Opt) (bool, error)

ApplyLayer applies a single layer on top of the given provided layer chain, using the provided snapshotter and applier. If the layer was unpacked true is returned, if the layer already exists false is returned.

func ApplyLayerWithOpts added in v1.3.0

func ApplyLayerWithOpts(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts []snapshots.Opt, applyOpts []diff.ApplyOpt) (bool, error)

ApplyLayerWithOpts applies a single layer on top of the given provided layer chain, using the provided snapshotter, applier, and apply opts. If the layer was unpacked true is returned, if the layer already exists false is returned.

func ApplyLayers

func ApplyLayers(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Applier) (digest.Digest, error)

ApplyLayers applies all the layers using the given snapshotter and applier. The returned result is a chain id digest representing all the applied layers. Layers are applied in order they are given, making the first layer the bottom-most layer in the layer chain.

func ApplyLayersWithOpts added in v1.3.0

func ApplyLayersWithOpts(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Applier, applyOpts []diff.ApplyOpt) (digest.Digest, error)

ApplyLayersWithOpts applies all the layers using the given snapshotter, applier, and apply opts. The returned result is a chain id digest representing all the applied layers. Layers are applied in order they are given, making the first layer the bottom-most layer in the layer chain.

func CreateDiff added in v1.1.0

func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter, d diff.Comparer, opts ...diff.Opt) (ocispec.Descriptor, error)

CreateDiff creates a layer diff for the given snapshot identifier from the parent of the snapshot. A content ref is provided to track the progress of the content creation and the provided snapshotter and mount differ are used for calculating the diff. The descriptor for the layer diff is returned.

func InitRootFS

func InitRootFS(ctx context.Context, name string, parent digest.Digest, readonly bool, snapshotter snapshots.Snapshotter, mounter Mounter) ([]mount.Mount, error)

InitRootFS initializes the snapshot for use as a rootfs

Types

type Layer

type Layer struct {
	Diff ocispec.Descriptor
	Blob ocispec.Descriptor
}

Layer represents the descriptors for a layer diff. These descriptions include the descriptor for the uncompressed tar diff as well as a blob used to transport that tar. The blob descriptor may or may not describe a compressed object.

type Mounter

type Mounter interface {
	Mount(target string, mounts ...mount.Mount) error
	Unmount(target string) error
}

Mounter handles mount and unmount

Jump to

Keyboard shortcuts

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