registry

package
v2.24.11 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package registry groups all container registry related types and helpers in one place.

Index

Constants

View Source
const (
	// RegistryDocker exists to prevent an import loop between the resources and this package.
	RegistryDocker = "docker.io"
)

Variables

This section is empty.

Functions

func Must added in v2.22.0

func Must(s string, err error) string

func RewriteImage added in v2.22.0

func RewriteImage(image, overwriteRegistry string) (string, error)

RewriteImage will apply the given overwriteRegistry to a given docker image reference.

Types

type ImageRewriter added in v2.22.0

type ImageRewriter func(string) (string, error)

ImageRewriter is a function that takes a Docker image reference (for example "docker.io/repo/image:tag@sha256:abc123") and potentially changes the registry to point to a local registry. It's a distinct type from WithOverwriteFunc as it does not just work on a registry, but a full image reference.

func GetImageRewriterFunc added in v2.22.0

func GetImageRewriterFunc(overwriteRegistry string) ImageRewriter

GetImageRewriterFunc returns a ImageRewriter that will apply the given overwriteRegistry to a given docker image reference.

type WithOverwriteFunc

type WithOverwriteFunc func(string) string

WithOverwriteFunc is a function that takes a string and either returns that string or a defined override value.

func GetOverwriteFunc

func GetOverwriteFunc(overwriteRegistry string) WithOverwriteFunc

GetOverwriteFunc returns a WithOverwriteFunc based on the given override value. Deprecated: This function should not be used anymore. Use the much more flexible GetImageRewriterFunc instead.

Jump to

Keyboard shortcuts

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