registry

package
v3.0.0-...-d6c4d9c Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 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

func Must(s string, err error) string

func RewriteImage

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

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

Types

type ImageRewriter

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

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