snapshot

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFS added in v0.2.0

func CompareFS(fs1, fs2 *MemFS, image1Name, image2Name image.Name, ignoreModTime bool)

CompareFS is the public API for comparing merged layers of two images for differences.

func CreateTarFromDirectory

func CreateTarFromDirectory(target, dir string) error

CreateTarFromDirectory creates a tar archive containing the contents of the given directory. It also compresses the contents with given compression level.

Types

type CopyOperation

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

CopyOperation defines a copy operation that occurred to generate a layer from.

func NewCopyOperation

func NewCopyOperation(
	srcs []string, srcRoot, workDir, dst, chownStr string,
	blacklist []string, internal, preserveOwner bool) (*CopyOperation, error)

NewCopyOperation initializes and validates a CopyOperation. Use "internal" to specify if the copy op is used for copying from previous stages.

func (*CopyOperation) Execute

func (c *CopyOperation) Execute() error

Execute performs the actual copying of files specified by the CopyOperation.

type MemFS

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

MemFS contains a collection of in-memory layers and a merged fs view.

func NewMemFS

func NewMemFS(clk clock.Clock, root string, blacklist []string) (*MemFS, error)

NewMemFS inits a new MemFS instance.

func (*MemFS) AddLayerByCopyOps

func (fs *MemFS) AddLayerByCopyOps(cs []*CopyOperation, w *tar.Writer) error

AddLayerByCopyOps creates an in-memory layer by performing copy operations on the given src-dst pairs. The file system is not modified during this operation. The resulting layer is merged in memory and written to the tar writer.

func (*MemFS) AddLayerByScan

func (fs *MemFS) AddLayerByScan(w *tar.Writer) error

AddLayerByScan creates an in-memory layer by scanning the differences between the file system and existing in-memory merged layers. The resulting layer is merged in memory and written to the tar writer.

func (*MemFS) Checkpoint

func (fs *MemFS) Checkpoint(newRoot string, sources []string) error

Checkpoint relocates the given src files & directories to the given newRoot.

func (*MemFS) Remove

func (fs *MemFS) Remove() error

Remove removes everything under the root of the memFS.

func (*MemFS) Reset

func (fs *MemFS) Reset()

Reset resets the in-memory file system view of the memFS.

func (*MemFS) UpdateFromTarPath

func (fs *MemFS) UpdateFromTarPath(source string, untar bool) error

UpdateFromTarPath updates MemFS with the contents of the tarball at the given path. untars the tarball onto the root of MemFS 'untar' specifies if the contents should also be written to disk at the MemFS root or not.

func (*MemFS) UpdateFromTarReader

func (fs *MemFS) UpdateFromTarReader(r *tar.Reader, untar bool) error

UpdateFromTarReader updates MemFS with the contents of the tarball from the given reader, and optionally untars the tarball onto the root of MemFS.

Jump to

Keyboard shortcuts

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