containerdregistry

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: Apache-2.0 Imports: 38 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver(configDir string, skipTlSVerify, plainHTTP bool, roots *x509.CertPool) (remotes.Resolver, error)

Types

type Registry

type Registry struct {
	Store
	// contains filtered or unexported fields
}

Registry enables manipulation of images via containerd modules.

func NewRegistry

func NewRegistry(options ...RegistryOption) (registry *Registry, err error)

NewRegistry returns a new containerd Registry and a function to destroy it after use. The destroy function is safe to call more than once, but is a no-op after the first call.

func (*Registry) Destroy

func (r *Registry) Destroy() (err error)

Destroy cleans up the on-disk boltdb file and other cache files, unless preserve cache is true

func (*Registry) Labels

func (r *Registry) Labels(ctx context.Context, ref image.Reference) (map[string]string, error)

Labels gets the labels for an image reference.

func (*Registry) Pull

func (r *Registry) Pull(ctx context.Context, ref image.Reference) error

Pull fetches and stores an image by reference.

func (*Registry) Unpack

func (r *Registry) Unpack(ctx context.Context, ref image.Reference, dir string) error

Unpack writes the unpackaged content of an image to a directory. If the referenced image does not exist in the registry, an error is returned.

type RegistryConfig

type RegistryConfig struct {
	Log               *logrus.Entry
	ResolverConfigDir string
	DBPath            string
	CacheDir          string
	PreserveCache     bool
	SkipTLSVerify     bool
	PlainHTTP         bool
	Roots             *x509.CertPool
}

type RegistryOption

type RegistryOption func(config *RegistryConfig)

func PreserveCache

func PreserveCache(preserve bool) RegistryOption

func SkipTLSVerify

func SkipTLSVerify(skip bool) RegistryOption

func WithCacheDir

func WithCacheDir(dir string) RegistryOption

func WithLog

func WithLog(log *logrus.Entry) RegistryOption

func WithPlainHTTP

func WithPlainHTTP(insecure bool) RegistryOption

func WithResolverConfigDir

func WithResolverConfigDir(path string) RegistryOption

func WithRootCAs

func WithRootCAs(pool *x509.CertPool) RegistryOption

type Store

type Store interface {
	Images() images.Store
	Content() content.Store
}

Jump to

Keyboard shortcuts

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