importer

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2016 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKeyV1RegistryClient = "v1-registry-client"

Add a dockerregistry.Client to the passed context with this key to support v1 Docker registry importing

Variables

View Source
var (
	NoCredentials auth.CredentialStore = &noopCredentialStore{}
)

Functions

func NewLocalCredentials

func NewLocalCredentials() auth.CredentialStore

func NewRetryRepository added in v1.3.0

func NewRetryRepository(repo distribution.Repository, retries int, interval time.Duration) distribution.Repository

NewRetryRepository wraps a distribution.Repository with helpers that will retry authentication failures over a limited time window and duration. This primarily avoids a DockerHub issue where public images unexpectedly return a 401 error due to the JWT token created by the hub being created at the same second, but another server being in the previous second.

Types

type BasicCredentials

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

func NewBasicCredentials

func NewBasicCredentials() *BasicCredentials

func (*BasicCredentials) Add

func (c *BasicCredentials) Add(url *url.URL, username, password string)

func (*BasicCredentials) Basic

func (c *BasicCredentials) Basic(url *url.URL) (string, string)

func (*BasicCredentials) RefreshToken added in v1.3.0

func (c *BasicCredentials) RefreshToken(url *url.URL, service string) string

func (*BasicCredentials) SetRefreshToken added in v1.3.0

func (c *BasicCredentials) SetRefreshToken(url *url.URL, service string, token string)

type Context

type Context struct {
	Transport         http.RoundTripper
	InsecureTransport http.RoundTripper
	Challenges        auth.ChallengeManager
}

func NewContext

func NewContext(transport, insecureTransport http.RoundTripper) Context

NewContext is capable of creating RepositoryRetrievers.

func (Context) WithCredentials

func (c Context) WithCredentials(credentials auth.CredentialStore) RepositoryRetriever

type ErrNotV2Registry

type ErrNotV2Registry struct {
	Registry string
}

ErrNotV2Registry is returned when the server does not report itself as a V2 Docker registry

func (*ErrNotV2Registry) Error

func (e *ErrNotV2Registry) Error() string

type ImageStreamImporter

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

ImageStreamImport implements an import strategy for Docker images. It keeps a cache of images per distinct auth context to reduce duplicate loads. This type is not thread safe.

func NewImageStreamImporter

func NewImageStreamImporter(retriever RepositoryRetriever, maximumTagsPerRepo int, limiter flowcontrol.RateLimiter) *ImageStreamImporter

NewImageStreamImport creates an importer that will load images from a remote Docker registry into an ImageStreamImport object. Limiter may be nil.

func (*ImageStreamImporter) Import

Import tries to complete the provided isi object with images loaded from remote registries.

type Interface

type Interface interface {
	Import(ctx gocontext.Context, isi *api.ImageStreamImport) error
}

Interface loads images into an image stream import request.

type RepositoryRetriever

type RepositoryRetriever interface {
	// Repository returns a properly authenticated distribution.Repository for the given registry, repository
	// name, and insecure toleration behavior.
	Repository(ctx gocontext.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)
}

RepositoryRetriever fetches a Docker distribution.Repository.

type SecretCredentialStore

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

func NewCredentialsForSecrets

func NewCredentialsForSecrets(secrets []kapi.Secret) *SecretCredentialStore

func NewLazyCredentialsForSecrets

func NewLazyCredentialsForSecrets(secretsFn func() ([]kapi.Secret, error)) *SecretCredentialStore

func (*SecretCredentialStore) Basic

func (s *SecretCredentialStore) Basic(url *url.URL) (string, string)

func (*SecretCredentialStore) Err

func (s *SecretCredentialStore) Err() error

func (*SecretCredentialStore) RefreshToken added in v1.3.0

func (s *SecretCredentialStore) RefreshToken(url *url.URL, service string) string

func (*SecretCredentialStore) SetRefreshToken added in v1.3.0

func (s *SecretCredentialStore) SetRefreshToken(url *url.URL, service string, token string)

Jump to

Keyboard shortcuts

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