mutate

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(base v1.Image, ms ...Mutation) (v1.Image, error)

Apply performs the specified mutation(s) to a base image, returning the resulting image.

func Squash

func Squash(base v1.Image) (v1.Image, error)

Squash replaces the layers in the base image with a single, squashed layer.

func SquashfsLayer

func SquashfsLayer(base v1.Layer, dir string, opts ...SquashfsConverterOpt) (v1.Layer, error)

SquashfsLayer converts the base layer into a layer using the squashfs format. A dir must be specified, which is used as a working directory during conversion. The caller is responsible for cleaning up dir.

By default, this will attempt to locate a suitable TAR to SquashFS converter such as 'tar2sqfs' or `sqfstar` via exec.LookPath. To specify a path to a specific converter program, consider using OptSquashfsLayerConverter.

By default, AUFS whiteout markers in the base TAR layer will be converted to OverlayFS whiteout markers in the SquashFS layer. This can be disabled, e.g. where it is known that the layer is part of a squashed image that will not have any whiteouts, using OptSquashfsSkipWhiteoutConversion.

Note - when whiteout conversion is performed the base layer will be read twice. Callers should ensure it is cached, and is not a streaming layer.

Types

type Mutation

type Mutation func(*image) error

func ReplaceLayers

func ReplaceLayers(l v1.Layer) Mutation

ReplaceLayers replaces all layers in the image with l. The layer is annotated with the specified values.

func SetConfig added in v0.3.0

func SetConfig(configFile any, configType types.MediaType) Mutation

SetConfig replaces the config with the specified raw content of type t.

func SetHistory

func SetHistory(history v1.History) Mutation

SetHistory replaces the history in an image with the specified entry.

func SetLayer

func SetLayer(i int, l v1.Layer) Mutation

SetLayer sets the layer at index i to l.

type SquashfsConverterOpt added in v0.4.0

type SquashfsConverterOpt func(*squashfsConverter) error

SquashfsConverterOpt are used to specify squashfs converter options.

func OptSquashfsLayerConverter added in v0.4.0

func OptSquashfsLayerConverter(converter string) SquashfsConverterOpt

OptSquashfsLayerConverter specifies the converter program to use when converting from TAR to SquashFS format.

func OptSquashfsSkipWhiteoutConversion added in v0.6.0

func OptSquashfsSkipWhiteoutConversion(b bool) SquashfsConverterOpt

OptSquashfsSkipWhiteoutConversion is set to skip the default conversion of whiteout / opaque markers from AUFS to OverlayFS format.

Jump to

Keyboard shortcuts

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