sysregistriesv2

package
v0.0.0-...-8841ed7 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidateCache

func InvalidateCache()

InvalidateCache invalidates the registry cache. This function is meant to be used for long-running processes that need to reload potential changes made to the cached registry config files.

Types

type InvalidRegistries

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

InvalidRegistries represents an invalid registry configurations. An example is when "registry.com" is defined multiple times in the configuration but with conflicting security settings.

func (*InvalidRegistries) Error

func (e *InvalidRegistries) Error() string

Error returns the error string.

type Mirror

type Mirror struct {
	// The mirror's URL.
	URL string `toml:"url"`
	// If true, certs verification will be skipped and HTTP (non-TLS)
	// connections will be allowed.
	Insecure bool `toml:"insecure"`
}

Mirror represents a mirror. Mirrors can be used as pull-through caches for registries.

type Registry

type Registry struct {
	// Serializable registry URL.
	URL string `toml:"url"`
	// The registry's mirrors.
	Mirrors []Mirror `toml:"mirror"`
	// If true, pulling from the registry will be blocked.
	Blocked bool `toml:"blocked"`
	// If true, certs verification will be skipped and HTTP (non-TLS)
	// connections will be allowed.
	Insecure bool `toml:"insecure"`
	// If true, the registry can be used when pulling an unqualified image.
	Search bool `toml:"unqualified-search"`
	// Prefix is used for matching images, and to translate one namespace to
	// another.  If `Prefix="example.com/bar"`, `URL="example.com/foo/bar"`
	// and we pull from "example.com/bar/myimage:latest", the image will
	// effectively be pulled from "example.com/foo/bar/myimage:latest".
	// If no Prefix is specified, it defaults to the specified URL.
	Prefix string `toml:"prefix"`
}

Registry represents a registry.

func FindRegistry

func FindRegistry(ctx *types.SystemContext, ref string) (*Registry, error)

FindRegistry returns the Registry with the longest prefix for ref, which is a registry, repository namespace repository or image reference (as formatted by reference.Domain(), reference.Named.Name() or reference.Reference.String() — note that this requires the name to start with an explicit hostname!). If no Registry prefixes the image, nil is returned.

func FindUnqualifiedSearchRegistries

func FindUnqualifiedSearchRegistries(ctx *types.SystemContext) ([]Registry, error)

FindUnqualifiedSearchRegistries returns all registries that are configured for unqualified image search (i.e., with Registry.Search == true).

func GetRegistries

func GetRegistries(ctx *types.SystemContext) ([]Registry, error)

GetRegistries loads and returns the registries specified in the config. Note the parsed content of registry config files is cached. For reloading, use `InvalidateCache` and re-call `GetRegistries`.

Jump to

Keyboard shortcuts

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