layer

package
v0.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

README

umoci/image/layer

This is my own implementation of the currently under development oci-create-layer functions. The reason for implementing this myself is that we use mtree specifications which are not the same method that oci-create-layer uses. While the two implementations could be combined (since this implementation is more general), in order to speed things up I just decided to implement it myself.

This also implements oci-create-runtime-bundle, since it's under layer management. The real difference is that we've split up the API (and based it on CAS) so we have more control when generating the bundle.

I'm hoping that this will be merged upstream, but since it's just a whiteout tar archive generator there isn't a huge requirement that this is kept up to date. Though, it should be noted that the whiteout format may change in the future.

Documentation

Index

Constants

View Source
const RootfsName = "rootfs"

RootfsName is the name of the rootfs directory inside the bundle path when generated.

Variables

This section is empty.

Functions

func GenerateLayer

func GenerateLayer(path string, deltas []mtree.InodeDelta) (io.ReadCloser, error)

GenerateLayer creates a new OCI diff layer based on the mtree diff provided. All of the mtree.Modified and mtree.Extra blobs are read relative to the provided path (which should be the rootfs of the layer that was diffed). The returned reader is for the *raw* tar data, it is the caller's responsibility to gzip it.

func UnpackLayer

func UnpackLayer(root string, layer io.Reader) error

UnpackLayer unpacks the tar stream representing an OCI layer at the given root. It ensures that the state of the root is as close as possible to the state used to create the layer. If an error is returned, the state of root is undefined (unpacking is not guaranteed to be atomic).

func UnpackManifest

func UnpackManifest(ctx context.Context, engine cas.Engine, bundle string, manifest v1.Manifest) error

UnpackManifest extracts all of the layers in the given manifest, as well as generating a runtime bundle and configuration. The rootfs is extracted to <bundle>/<layer.RootfsName>. Some verification is done during image extraction.

FIXME: This interface is ugly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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