Documentation ¶
Overview ¶
Package registry implements the various functions needed to store and retrieve images from a container registry.
Index ¶
- Constants
- func ExportRegistryNames(log logr.Logger, secretLoader git.SecretLister) ([]string, error)
- func ExtractImageParts(imageURL string) (string, string, error)
- func GetRegistryUrlFromSecret(secret v1.Secret) (string, error)
- func Validate(url, namespace, username, password string) error
- type ConnectionDetails
- type ContainerRegistryAuth
- type DockerConfigJSON
- type ExportRegistry
- type RegistryCredentials
Constants ¶
const ( RegistrySecretNamespaceAnnotationKey = "epinio.io/registry-namespace" // nolint:gosec // not credentials CredentialsSecretName = "registry-creds" )
Variables ¶
This section is empty.
Functions ¶
func ExportRegistryNames ¶ added in v1.10.0
func ExtractImageParts ¶
ExtractImageParts accepts a container image URL and returns the registry and the image parts.
func GetRegistryUrlFromSecret ¶ added in v1.10.0
Types ¶
type ConnectionDetails ¶
type ConnectionDetails struct { RegistryCredentials []RegistryCredentials Namespace string }
func GetConnectionDetails ¶
func GetConnectionDetails(ctx context.Context, cluster *kubernetes.Cluster, secretNamespace, secretName string) (*ConnectionDetails, error)
GetConnectionDetails retrieves registry connection details from a Kubernetes secret.
func (*ConnectionDetails) PrivateRegistryURL ¶
func (d *ConnectionDetails) PrivateRegistryURL() (string, error)
PrivateRegistryURL returns the internal (localhost) registry URL. That url can be used by Kubernetes to pull images only when the internal registry is used and exposed over NodePort. This method will return an empty string if no localhost URL exists in the config.
func (*ConnectionDetails) PublicRegistryURL ¶
func (d *ConnectionDetails) PublicRegistryURL() (string, error)
PublicRegistryURL returns the public registry URL from the connection details object. Assumes to have only one non-local registry in the config. If there are more, it will just return the first one found (no guaranteed order since there should only be one)
func (*ConnectionDetails) ReplaceWithInternalRegistry ¶
func (d *ConnectionDetails) ReplaceWithInternalRegistry(imageURL string) (string, error)
type ContainerRegistryAuth ¶
type DockerConfigJSON ¶
type DockerConfigJSON struct {
Auths map[string]ContainerRegistryAuth `json:"auths"`
}
type ExportRegistry ¶ added in v1.10.0
func ExportRegistries ¶ added in v1.10.0
func ExportRegistries(log logr.Logger, secretLoader git.SecretLister) ([]ExportRegistry, error)
type RegistryCredentials ¶
func GetRegistryCredentialsFromSecret ¶ added in v1.10.0
func GetRegistryCredentialsFromSecret(secret v1.Secret) (RegistryCredentials, error)