registry

package
v7.1.1+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DockerCFG lets registries know its token, and endpoint should be used in
	// the format of a ~/.dockercfg file
	DockerCFG string = "dockercfg"
	// DockerJSON lets registries know its token, and endpoint should be used
	// in the format of a ~/.docker/config.json file
	DockerJSON string = "dockerconfigjson"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Default

type Default struct {
	Credentials map[string]string
	// contains filtered or unexported fields
}

Default is the type of registry if they don't need special logic

func (Default) CreateAuthToken

func (d Default) CreateAuthToken() (csv3.AuthTokenDef, error)

CreateAuthToken returns a base64 encrypted token to use as an Auth token

func (Default) Endpoint

func (d Default) Endpoint() string

Endpoint returns the endpoint that should be used for the container registry

func (Default) Password

func (d Default) Password() string

Password returns the registry password that should be used for auth

func (Default) Username

func (d Default) Username() string

Username returns the registry username that should be used for auth

type ECR

type ECR struct {
	Credentials map[string]string
}

ECR defines a registry on AWS

func (ECR) AccessKey

func (e ECR) AccessKey() string

AccessKey returns the access key id from credentials

func (ECR) CreateAuthToken

func (e ECR) CreateAuthToken() (csv3.AuthTokenDef, error)

CreateAuthToken returns a token that can be used to authenticate with AWS registries

func (ECR) Region

func (e ECR) Region() string

Region returns the region to auth to on AWS, with a default return value of 'us-east-1'

func (ECR) SecretKey

func (e ECR) SecretKey() string

SecretKey returns the secret key from credentials

type GCR

type GCR struct {
	Default
}

GCR is a google container registry which needs a different kind of auth token created to work as an image pull secret

func (GCR) CreateAuthToken

func (g GCR) CreateAuthToken() (csv3.AuthTokenDef, error)

CreateAuthToken returns a base64 encrypted token to use as an Auth token

type Generator

type Generator interface {
	CreateAuthToken() (csv3.AuthTokenDef, error)
}

Generator allows us to access and return registry logic in the same way for all registries

func New

func New(provider, endpoint string, credentials map[string]string) Generator

New returns a Generator of the correct type to be able to get the AuthToken for the registry

Jump to

Keyboard shortcuts

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