registryoverride

package
v0.1.78 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package registryoverride applies registry-prefix overrides to image references with strict, deterministic matching semantics. It is intentionally a leaf package with no project-internal imports so it can be used both from support/releaseinfo and from sub-packages that depend on it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replace

func Replace(image string, overrides map[string]string) string

Replace remaps an image reference using a set of registry-prefix overrides. The overrides map keys are source registry prefixes and values are replacement prefixes.

Matching is strict: an override applies only when the image reference is exactly equal to the source key or starts with the source key followed by a valid image-reference separator ("/" for path components, "@" for digests, or ":" for tags). This prevents accidental substring matches (e.g. an override for "quay.io" must not match "quay.io.example.com/foo") while correctly handling repository-level overrides against digest references (e.g. "quay.io/org/repo" must match "quay.io/org/repo@sha256:abc").

When several override keys match the same image, the longest key wins. This makes the result deterministic regardless of map iteration order and lets callers express both broad ("quay.io") and narrow ("quay.io/openshift-release-dev") overrides simultaneously.

If no override matches, image is returned unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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