imageref

package
v1.13.13 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MPL-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package imageref provides canonical normalization of container image references.

Talos parses an image reference in several places on a single pull: to match it against the image verification policy, to look up the registry mirror, auth and TLS configuration, and to hand it to containerd for the actual pull. All of those have to agree on a single spelling of the reference, otherwise the policy decision can be made about one image while a different one is pulled.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizePattern

func NormalizePattern(pattern string) string

NormalizePattern normalizes the registry domain of an image reference glob pattern, so that the pattern is matched in the same namespace the output of RepositoryKey is in.

Only the domain part of the pattern is normalized: the repository part of a canonical reference is always lower-case already, so folding its case would make a pattern match references it was not written for.

func Parse

func Parse(imageRef string) (reference.Named, error)

Parse parses a container image reference and returns it in the canonical form used throughout Talos.

On top of the normalization done by github.com/distribution/reference (defaulting the domain, adding the implicit `library/` namespace on Docker Hub, defaulting the tag to `latest` and dropping the tag from a reference carrying both a tag and a digest), the registry domain is lower-cased, as registry domains are DNS names and DNS is case-insensitive, and the alternative spellings of the Docker Hub domain, `index.docker.io` and `registry-1.docker.io`, are folded into `docker.io`.

Normalization is idempotent: parsing the result again yields the same reference.

func RepositoryKey

func RepositoryKey(namedRef reference.Named) string

RepositoryKey returns the canonical `<registry>/<repository>` form of the reference, with the tag and the digest stripped.

This is the key image verification rules are matched against.

Types

This section is empty.

Jump to

Keyboard shortcuts

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