store

package
v0.0.0-...-ed4b4ac Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

See https://github.com/containers/image/blob/master/docs/policy.json.md

Index

Constants

View Source
const (
	AnnotationImported = "com.github.mgoltzsche.cntnr.image.imported"
)
View Source
const AnnotationParentImage = "com.github.mgoltzsche.cntnr.image.parent"

Variables

This section is empty.

Functions

func IsMtreeNotExist

func IsMtreeNotExist(err error) bool

Types

type BlobStore

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

func NewBlobStore

func NewBlobStore(dir string, debug log.Logger) (r BlobStore)

func (*BlobStore) BlobFileInfo

func (s *BlobStore) BlobFileInfo(id digest.Digest) (st os.FileInfo, err error)

func (*BlobStore) PutLayer

func (s *BlobStore) PutLayer(reader io.Reader) (layer ispecs.Descriptor, diffIdDigest digest.Digest, err error)

func (*BlobStore) RetainBlobs

func (s *BlobStore) RetainBlobs(keep map[digest.Digest]bool) (err error)

type BlobStoreOci

type BlobStoreOci struct {
	*BlobStore
	// contains filtered or unexported fields
}

func NewBlobStoreExt

func NewBlobStoreExt(blobStore *BlobStore, mtreeStore *MtreeStore, rootless bool, debug log.Logger) BlobStoreOci

func (*BlobStoreOci) ImageConfig

func (s *BlobStoreOci) ImageConfig(configDigest digest.Digest) (r ispecs.Image, err error)

func (*BlobStoreOci) ImageManifest

func (s *BlobStoreOci) ImageManifest(manifestDigest digest.Digest) (r ispecs.Manifest, err error)

func (*BlobStoreOci) NewLayerSource

func (s *BlobStoreOci) NewLayerSource(rootfs string, files []string, deltafs bool) (src *LayerSource, err error)

func (*BlobStoreOci) PutImageConfig

func (s *BlobStoreOci) PutImageConfig(cfg ispecs.Image, parentManifest *digest.Digest, m modifier) (d ispecs.Descriptor, manifest ispecs.Manifest, err error)

func (*BlobStoreOci) PutImageLayer

func (s *BlobStoreOci) PutImageLayer(src *LayerSource, parentManifestDigest *digest.Digest, author, createdBy string) (r *CommitResult, err error)

Writes the diff of rootfs to its parent as new layer into the store

func (*BlobStoreOci) UnpackLayers

func (s *BlobStoreOci) UnpackLayers(manifestDigest digest.Digest, rootfs string) (err error)

Unpacks all layers contained in the referenced manifest into rootfs

type CommitResult

type CommitResult struct {
	Manifest   ispecs.Manifest
	Config     ispecs.Image
	Descriptor ispecs.Descriptor
}

type ImageFSROCache

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

func NewImageFSROCache

func NewImageFSROCache(dir string) *ImageFSROCache

func (*ImageFSROCache) GetRootfs

func (s *ImageFSROCache) GetRootfs(img *image.Image) (dir string, err error)

type ImageID

type ImageID struct {
	ID             digest.Digest
	ManifestDigest digest.Digest
	LastUsed       time.Time
}

func (ImageID) String

func (s ImageID) String() string

type ImageIdStore

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

func NewImageIdStore

func NewImageIdStore(dir string) (r ImageIdStore)

func (*ImageIdStore) Add

func (s *ImageIdStore) Add(imageID, manifestDigest digest.Digest) (err error)

func (*ImageIdStore) Del

func (s *ImageIdStore) Del(imageID digest.Digest) (err error)

func (*ImageIdStore) ImageID

func (s *ImageIdStore) ImageID(imageID digest.Digest) (r ImageID, err error)

func (*ImageIdStore) ImageIDs

func (s *ImageIdStore) ImageIDs() (r []ImageID, err error)

func (*ImageIdStore) MarkUsed

func (s *ImageIdStore) MarkUsed(id digest.Digest) (err error)

type ImageRepo

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

func OpenImageRepo

func OpenImageRepo(dir, externalBlobDir string, create bool) (r *ImageRepo, err error)

func (*ImageRepo) AddRef

func (r *ImageRepo) AddRef(descriptor ispecs.Descriptor)

func (*ImageRepo) Close

func (r *ImageRepo) Close() (err error)

func (*ImageRepo) DelRef

func (r *ImageRepo) DelRef(ref string)

type ImageStore

type ImageStore struct {
	*ImageStoreRO
	// contains filtered or unexported fields
}

func NewImageStore

func NewImageStore(store *ImageStoreRO, fsCache *ImageFSROCache, temp string, systemContext *types.SystemContext, trustPolicy TrustPolicyContext, rootless bool, loggers log.Loggers) (*ImageStore, error)

func (*ImageStore) DelImage

func (s *ImageStore) DelImage(ids ...digest.Digest) (err error)

func (*ImageStore) ImageGC

func (s *ImageStore) ImageGC(before time.Time) (err error)

func (*ImageStore) OpenLockedImageStore

func (s *ImageStore) OpenLockedImageStore() (image.ImageStoreRW, error)

type ImageStoreRO

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

func NewImageStoreRO

func NewImageStoreRO(dir string, blobStore *BlobStoreOci, imageIds ImageIdStore, warn log.Logger) (r *ImageStoreRO)

func (*ImageStoreRO) Image

func (s *ImageStoreRO) Image(id digest.Digest) (r image.Image, err error)

func (*ImageStoreRO) ImageByName

func (s *ImageStoreRO) ImageByName(nameRef string) (r image.Image, err error)

func (*ImageStoreRO) ImageConfig

func (s *ImageStoreRO) ImageConfig(id digest.Digest) (ispecs.Image, error)

func (*ImageStoreRO) Images

func (s *ImageStoreRO) Images() (r []image.Image, err error)

func (*ImageStoreRO) UnpackImageLayers

func (s *ImageStoreRO) UnpackImageLayers(imageId digest.Digest, rootfs string) (err error)

func (*ImageStoreRO) WithNonAtomicAccess

func (s *ImageStoreRO) WithNonAtomicAccess() *ImageStoreRO

type ImageStoreRW

type ImageStoreRW struct {
	*ImageStoreRO
	// contains filtered or unexported fields
}

func NewImageStoreRW

func NewImageStoreRW(locker lock.Locker, roStore *ImageStoreRO, fsCache *ImageFSROCache, tmpDir string, systemContext *types.SystemContext, trustPolicy TrustPolicyContext, rootless bool, loggers log.Loggers) (r *ImageStoreRW, err error)

func (*ImageStoreRW) AddImageConfig

func (s *ImageStoreRW) AddImageConfig(conf ispecs.Image, parentImageId *digest.Digest) (img image.Image, err error)

func (*ImageStoreRW) AddImageLayer

func (s *ImageStoreRW) AddImageLayer(src image.LayerSource, parentImageId *digest.Digest, author, comment string) (r image.Image, err error)

func (*ImageStoreRW) Close

func (s *ImageStoreRW) Close() (err error)

func (*ImageStoreRW) ImportImage

func (s *ImageStoreRW) ImportImage(src string) (img image.Image, err error)

func (*ImageStoreRW) MarkUsedImage

func (s *ImageStoreRW) MarkUsedImage(id digest.Digest) error

func (*ImageStoreRW) NewLayerSource

func (s *ImageStoreRW) NewLayerSource(rootfs string) (r image.LayerSource, err error)

func (*ImageStoreRW) NewLayerSourceFromImage

func (s *ImageStoreRW) NewLayerSourceFromImage(rootfs string, img image.Image, filePattern []string, dest string, usr *idutils.UserIds) (r image.LayerSource, err error)

func (*ImageStoreRW) NewLayerSourceOverlayed

func (s *ImageStoreRW) NewLayerSourceOverlayed(rootfs, srcDir string, srcPattern []string, dest string, usr *idutils.UserIds) (r image.LayerSource, err error)

func (*ImageStoreRW) TagImage

func (s *ImageStoreRW) TagImage(imageId digest.Digest, tag string) (img image.Image, err error)

Creates a new image ref. Overwrites existing refs.

func (*ImageStoreRW) UntagImage

func (s *ImageStoreRW) UntagImage(tag string) (err error)

type LayerSource

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

func (*LayerSource) Close

func (s *LayerSource) Close() (err error)

func (*LayerSource) DiffHash

func (s *LayerSource) DiffHash() (d digest.Digest, err error)

type MtreeStore

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

TODO: RetainAll(manifestDigests)

func NewMtreeStore

func NewMtreeStore(dir string, fsEval mtree.FsEval, debug log.Logger) MtreeStore

func (*MtreeStore) Create

func (s *MtreeStore) Create(rootfs string) (dh *mtree.DirectoryHierarchy, err error)

func (*MtreeStore) Diff

func (s *MtreeStore) Diff(from, to *mtree.DirectoryHierarchy) (diffs []mtree.InodeDelta, err error)

func (*MtreeStore) Exists

func (s *MtreeStore) Exists(manifestDigest digest.Digest) (bool, error)

func (*MtreeStore) Get

func (s *MtreeStore) Get(manifestDigest digest.Digest) (spec *mtree.DirectoryHierarchy, err error)

func (*MtreeStore) Put

func (s *MtreeStore) Put(manifestDigest digest.Digest, spec *mtree.DirectoryHierarchy) (err error)

type TrustPolicyContext

type TrustPolicyContext interface {
	Policy() (*signature.PolicyContext, error)
}

func TrustPolicyDefault

func TrustPolicyDefault(ctx *types.SystemContext) TrustPolicyContext

func TrustPolicyFromFile

func TrustPolicyFromFile(file string) TrustPolicyContext

func TrustPolicyInsecure

func TrustPolicyInsecure() TrustPolicyContext

func TrustPolicyReject

func TrustPolicyReject() TrustPolicyContext

Jump to

Keyboard shortcuts

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