registry

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDockerConfig added in v1.5.0

func GenerateDockerConfig(c Client) ([]byte, error)

Types

type AuthConfig added in v1.5.0

type AuthConfig struct {
	Auth string `json:"auth,omitempty"`
}

type Client

type Client interface {
	CreateRepository(ctx context.Context, name string) error
	RepositoryExists() bool
	CopyImage(ctx context.Context, src ctypes.ImageReference, srcCreds string, dest ctypes.ImageReference, destCreds string) error
	PullImage() error
	PutImage() error
	ImageExists(ctx context.Context, ref ctypes.ImageReference) bool

	// Endpoint returns the domain of the registry
	Endpoint() string
	Credentials() string

	// IsOrigin returns true if the imageRef originates from this registry
	IsOrigin(imageRef ctypes.ImageReference) bool
}

Client provides methods required to be implemented by the various target registry clients, e.g. ECR, Docker, Quay.

func NewClient added in v1.5.0

func NewClient(r config.Registry) (Client, error)

NewClient returns a registry client ready for use without the need to specify an implementation

type DockerConfig added in v1.5.0

type DockerConfig struct {
	AuthConfigs map[string]AuthConfig `json:"auths"`
}

type ECRClient

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

func NewDummyECRClient added in v1.5.0

func NewDummyECRClient(region string, targetAccount string, role string, options config.ECROptions, authToken []byte) *ECRClient

For testing purposes

func NewECRClient

func NewECRClient(clientConfig config.AWS) (*ECRClient, error)

func NewMockECRClient added in v1.1.0

func NewMockECRClient(ecrClient ecriface.ECRAPI, region string, ecrDomain string, targetAccount, role string) (*ECRClient, error)

func (*ECRClient) CopyImage

func (e *ECRClient) CopyImage(ctx context.Context, srcRef ctypes.ImageReference, srcCreds string, destRef ctypes.ImageReference, destCreds string) error

func (*ECRClient) CreateRepository

func (e *ECRClient) CreateRepository(ctx context.Context, name string) error

func (*ECRClient) Credentials

func (e *ECRClient) Credentials() string

func (*ECRClient) Endpoint

func (e *ECRClient) Endpoint() string

func (*ECRClient) ImageExists

func (e *ECRClient) ImageExists(ctx context.Context, imageRef ctypes.ImageReference) bool

func (*ECRClient) IsOrigin added in v1.5.0

func (e *ECRClient) IsOrigin(imageRef ctypes.ImageReference) bool

IsOrigin returns true if the references origin is from this registry

func (*ECRClient) PullImage

func (e *ECRClient) PullImage() error

func (*ECRClient) PutImage

func (e *ECRClient) PutImage() error

func (*ECRClient) RepositoryExists

func (e *ECRClient) RepositoryExists() bool

type GARAPI added in v1.5.0

type GARAPI interface{}

type GARClient added in v1.5.0

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

func NewGARClient added in v1.5.0

func NewGARClient(clientConfig config.GCP) (*GARClient, error)

func NewMockGARClient added in v1.5.0

func NewMockGARClient(garClient GARAPI, garDomain string) (*GARClient, error)

func (*GARClient) CopyImage added in v1.5.0

func (e *GARClient) CopyImage(ctx context.Context, srcRef ctypes.ImageReference, srcCreds string, destRef ctypes.ImageReference, destCreds string) error

func (*GARClient) CreateRepository added in v1.5.0

func (e *GARClient) CreateRepository(ctx context.Context, name string) error

CreateRepository is empty since repositories are not created for artifact registry

func (*GARClient) Credentials added in v1.5.0

func (e *GARClient) Credentials() string

func (*GARClient) DockerConfig added in v1.5.0

func (e *GARClient) DockerConfig() ([]byte, error)

func (*GARClient) Endpoint added in v1.5.0

func (e *GARClient) Endpoint() string

func (*GARClient) ImageExists added in v1.5.0

func (e *GARClient) ImageExists(ctx context.Context, imageRef ctypes.ImageReference) bool

func (*GARClient) IsOrigin added in v1.5.0

func (e *GARClient) IsOrigin(imageRef ctypes.ImageReference) bool

IsOrigin returns true if the references origin is from this registry

func (*GARClient) PullImage added in v1.5.0

func (e *GARClient) PullImage() error

func (*GARClient) PutImage added in v1.5.0

func (e *GARClient) PutImage() error

func (*GARClient) RepositoryExists added in v1.5.0

func (e *GARClient) RepositoryExists() bool

Jump to

Keyboard shortcuts

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