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 ¶
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 ¶
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 ¶
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.