registries

package
v1.9.11 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRegistry is the registry name that will be used if no registry
	// provided and the default is not overridden.
	DefaultRegistry = "index.docker.io"

	// DefaultTag is the tag name that will be used if no tag provided and the
	// default is not overridden.
	DefaultTag = "latest"
)

Variables

This section is empty.

Functions

func Insecure

func Insecure(o *options)

Insecure is an Option that allows image references to be fetched without TLS.

Types

type Auth

type Auth struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

Auth the auth of image registry

type DockerConfig

type DockerConfig map[string]DockerConfigEntry

DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.

type DockerConfigEntry

type DockerConfigEntry struct {
	Username string
	Password string
	Email    string
	Auth     string
}

DockerConfigEntry wraps a docker config as an entry

type ImageRegistry

type ImageRegistry struct {
	Registry string `json:"registry"`
	Auth     Auth   `json:"auth"`
	Insecure bool   `json:"insecure"`
	UseHTTP  bool   `json:"useHTTP"`
}

ImageRegistry the request body for validating image registry

type Option

type Option func(*options)

Option is a functional option

func WithAuth

func WithAuth(auth authn.Authenticator) Option

WithAuth is a functional option for overriding the default authenticator for remote operations.

func WithContext

func WithContext(ctx context.Context) Option

WithContext is a functional option for setting the context.

func WithPlatform

func WithPlatform(platform *v1.Platform) Option

WithPlatform is an Option to specify the platform.

func WithTransport

func WithTransport(t http.RoundTripper) Option

WithTransport is a functional option for overriding the default transport for remote operations.

type RegistryHelper

type RegistryHelper interface {
	// Auth check if secret has correct credential to authenticate with remote registry
	Auth(ctx context.Context, imageRegistry *ImageRegistry) (bool, error)
}

RegistryHelper provides helper functions for common Registry operations

func NewRegistryHelper

func NewRegistryHelper() RegistryHelper

NewRegistryHelper creates a registry helper

type SecretAuthenticator

type SecretAuthenticator interface {
	Options() []Option

	Auth(ctx context.Context) (bool, error)

	Authorization() (*authn.AuthConfig, error)
}

SecretAuthenticator provides helper functions for secret authenticator operations

func NewSecretAuthenticator

func NewSecretAuthenticator(imageRegistry *ImageRegistry) (SecretAuthenticator, error)

NewSecretAuthenticator creates a secret authenticator

Jump to

Keyboard shortcuts

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