registry

package
v0.4.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialsConfigLoad added in v0.2.29

func CredentialsConfigLoad() (*configfile.ConfigFile, error)

CredentialsConfigLoad load credentials from directory.

func ExtractECRToken added in v0.3.12

func ExtractECRToken(token string) (*auth.Credential, error)

func GetCertificates

func GetCertificates(certFile string) (certificates *x509.CertPool, err error)

GetCertificates get X509 certificates.

func GetClusterCertificate added in v0.2.29

func GetClusterCertificate(clusterName string) (certificates *x509.CertPool, err error)

func GetClusterCertificateFileName added in v0.2.29

func GetClusterCertificateFileName(clusterName string) string

func GetCredential added in v0.3.12

func GetCredential(ecrClient *ecr.Client) (auth.Credential, error)

func GetECRClient added in v0.3.12

func GetECRClient(ctx context.Context, log logr.Logger) (*ecr.Client, error)

func GetRegistryInsecure added in v0.2.29

func GetRegistryInsecure(clusterName string) bool

func IsECRRegistry added in v0.3.12

func IsECRRegistry(registry string) bool

func PullBytes added in v0.2.25

func PullBytes(ctx context.Context, sc StorageClient, artifact Artifact) (data []byte, err error)

PullBytes a resource from the registry.

Types

type Artifact

type Artifact struct {
	Registry   string
	Repository string
	Tag        string
	Digest     string
}

Artifact to head release dependency.

func NewArtifact

func NewArtifact(registry, repository, tag, digest string) Artifact

NewArtifact creates a new artifact object.

func ParseArtifactFromURI added in v0.2.28

func ParseArtifactFromURI(uri string) (*Artifact, error)

ParseArtifactFromURI parses the URI into a new Artifact object.

func (Artifact) Version

func (art Artifact) Version() string

Version returns tag or digest.

func (Artifact) VersionedImage

func (art Artifact) VersionedImage() string

VersionedImage returns full URI for image.

type CertInjector added in v0.4.2

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

func NewCertInjector added in v0.4.2

func NewCertInjector(k8sClient client.Client, log logr.Logger) *CertInjector

NewCertInjector creates a new CertInjector.

func (*CertInjector) UpdateIfNeeded added in v0.4.2

func (ci *CertInjector) UpdateIfNeeded(ctx context.Context, clusterName string) error

UpdateIfNeeded is responsible for verifying the registry CA cert is available on the mounted `registry-mirror-cred` secret.

type DockerCredentialStore added in v0.2.29

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

DockerCredentialStore for Docker registry credentials, like ~/.docker/config.json.

func NewDockerCredentialStore added in v0.2.29

func NewDockerCredentialStore(configFile *configfile.ConfigFile) *DockerCredentialStore

NewDockerCredentialStore creates a DockerCredentialStore.

func (*DockerCredentialStore) Credential added in v0.2.29

func (cs *DockerCredentialStore) Credential(registry string) (auth.Credential, error)

Credential get an authentication credential for a given registry.

type ECRCredInjector added in v0.3.12

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

ECRCredInjector is an adapter to convert ECR credential to Docker credential. Since the converted docker credential is only valid for 12 hours, this adapter is constantly running. It's responsibility is to make sure docker config in the filesystem contains ECR credential to pull bundle yaml and charts.

func NewECRCredInjector added in v0.3.12

func NewECRCredInjector(ctx context.Context, k8sClient client.Client, log logr.Logger) (*ECRCredInjector, error)

func (*ECRCredInjector) GetECR added in v0.3.12

func (a *ECRCredInjector) GetECR(ctx context.Context) (string, error)

GetECR get the defaultRegistry config from package bundle controller.

func (*ECRCredInjector) GetRegistryMirrorSecret added in v0.3.12

func (a *ECRCredInjector) GetRegistryMirrorSecret(ctx context.Context) (*v1.Secret, error)

GetRegistryMirrorSecret gets registry mirror secret from eksa-packages namespace

func (*ECRCredInjector) InjectCredential added in v0.3.12

func (a *ECRCredInjector) InjectCredential(ctx context.Context, secret v1.Secret, registry string, cred auth.Credential) error

InjectCredential update field "config.json" in the secret, which is used by packages controller's oras and helm

func (*ECRCredInjector) Refresh added in v0.3.12

func (a *ECRCredInjector) Refresh(ctx context.Context) error

func (*ECRCredInjector) Run added in v0.3.12

func (a *ECRCredInjector) Run(ctx context.Context)

type OCIRegistryClient

type OCIRegistryClient struct {
	StorageContext
	// contains filtered or unexported fields
}

OCIRegistryClient storage client for an OCI registry.

func NewOCIRegistry

func NewOCIRegistry(sc StorageContext, registry *remote.Registry) *OCIRegistryClient

NewOCIRegistry create an OCI registry client.

func (*OCIRegistryClient) CopyGraph

func (or *OCIRegistryClient) CopyGraph(ctx context.Context, srcStorage, dstStorage orasregistry.Repository, desc ocispec.Descriptor) error

CopyGraph copy manifest and all blobs to destination.

func (*OCIRegistryClient) Destination

func (or *OCIRegistryClient) Destination(image Artifact) string

Destination of this storage registry.

func (*OCIRegistryClient) FetchBlob added in v0.2.25

func (or *OCIRegistryClient) FetchBlob(ctx context.Context, srcStorage orasregistry.Repository, descriptor ocispec.Descriptor) ([]byte, error)

FetchBlob get named blob.

func (*OCIRegistryClient) FetchBytes added in v0.2.25

func (or *OCIRegistryClient) FetchBytes(ctx context.Context, srcStorage orasregistry.Repository, artifact Artifact) (ocispec.Descriptor, []byte, error)

FetchBytes a resource from the registry.

func (*OCIRegistryClient) GetHost

func (or *OCIRegistryClient) GetHost() string

GetHost for registry host.

func (*OCIRegistryClient) GetStorage

func (or *OCIRegistryClient) GetStorage(ctx context.Context, artifact Artifact) (repo orasregistry.Repository, err error)

GetStorage object based on repository.

func (*OCIRegistryClient) Resolve

func (or *OCIRegistryClient) Resolve(ctx context.Context, srcStorage orasregistry.Repository, versionedImage string) (desc ocispec.Descriptor, err error)

Resolve the location of the source repository given the image.

func (*OCIRegistryClient) SetProject

func (or *OCIRegistryClient) SetProject(project string)

SetProject for registry destination.

type StorageClient

type StorageClient interface {
	Resolve(ctx context.Context, srcStorage orasregistry.Repository, versionedImage string) (desc ocispec.Descriptor, err error)
	GetStorage(ctx context.Context, image Artifact) (repo orasregistry.Repository, err error)
	SetProject(project string)
	Destination(image Artifact) string
	FetchBytes(ctx context.Context, srcStorage orasregistry.Repository, artifact Artifact) (ocispec.Descriptor, []byte, error)
	FetchBlob(ctx context.Context, srcStorage orasregistry.Repository, descriptor ocispec.Descriptor) ([]byte, error)
	CopyGraph(ctx context.Context, srcStorage, dstStorage orasregistry.Repository, desc ocispec.Descriptor) error
}

StorageClient interface for general image storage client.

type StorageContext

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

StorageContext describes aspects of a registry.

func NewStorageContext

func NewStorageContext(host string, credentialStore *DockerCredentialStore, certificates *x509.CertPool, insecure bool) StorageContext

NewStorageContext create registry context.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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