registry

package
v0.0.0-...-c42b1bb Latest Latest
Warning

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

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

Documentation

Overview

This package has types for dealing with image registries (e.g., quay.io, DockerHub, Google Container Registry, ..).

Index

Constants

View Source
const (
	LabelRequestKind    = "kind"
	RequestKindTags     = "tags"
	RequestKindMetadata = "metadata"
)

Variables

View Source
var (
	ErrNoImageData = errors.New("image data not available")
)

Functions

func GetGCPOauthToken

func GetGCPOauthToken(host string) (creds, error)

func ImageCredsWithDefaults

func ImageCredsWithDefaults(lookup func() ImageCreds, configPath string) (func() ImageCreds, error)

Types

type Client

type Client interface {
	Tags(context.Context) ([]string, error)
	Manifest(ctx context.Context, ref string) (ImageEntry, error)
}

Client is a remote registry client for a particular image repository (e.g., for quay.io/weaveworks/flux). It is an interface so we can wrap it in instrumentation, write fake implementations, and so on.

func NewInstrumentedClient

func NewInstrumentedClient(next Client) Client

type ClientFactory

type ClientFactory interface {
	ClientFor(image.CanonicalName, Credentials) (Client, error)
}

ClientFactory supplies Client implementations for a given repo, with credentials. This is an interface so we can provide fake implementations.

type Credentials

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

Credentials to a (Docker) registry.

func NoCredentials

func NoCredentials() Credentials

NoCredentials returns a usable but empty credentials object.

func ParseCredentials

func ParseCredentials(from string, b []byte) (Credentials, error)

func (Credentials) Hosts

func (cs Credentials) Hosts() []string

Hosts returns all of the hosts available in these credentials.

func (Credentials) Merge

func (cs Credentials) Merge(c Credentials)

func (Credentials) String

func (cs Credentials) String() string

type ImageCreds

type ImageCreds map[image.Name]Credentials

ImageCreds is a record of which images need which credentials, which is supplied to us (probably by interrogating the cluster)

type ImageEntry

type ImageEntry struct {
	image.Info     `json:",inline"`
	ExcludedReason string `json:",omitempty"`
}

type Registry

type Registry interface {
	GetRepositoryImages(image.Name) ([]image.Info, error)
	GetImage(image.Ref) (image.Info, error)
}

Registry is a store of image metadata.

func NewInstrumentedRegistry

func NewInstrumentedRegistry(next Registry) Registry

type Remote

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

func (*Remote) Manifest

func (a *Remote) Manifest(ctx context.Context, ref string) (ImageEntry, error)

Manifest fetches the metadata for an image reference; currently assumed to be in the same repo as that provided to `NewRemote(...)`

func (*Remote) Tags

func (a *Remote) Tags(ctx context.Context) ([]string, error)

Return the tags for this repository.

type RemoteClientFactory

type RemoteClientFactory struct {
	Logger        log.Logger
	Limiters      *middleware.RateLimiters
	Trace         bool
	InsecureHosts []string
	// contains filtered or unexported fields
}

func (*RemoteClientFactory) ClientFor

func (f *RemoteClientFactory) ClientFor(repo image.CanonicalName, creds Credentials) (Client, error)

Directories

Path Synopsis
This package implements an image metadata cache given a backing k-v store.
This package implements an image metadata cache given a backing k-v store.

Jump to

Keyboard shortcuts

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