Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindBestSemverMatch ¶
FindBestSemverMatch selects the tag whose semver value best satisfies the constraint. It returns the highest matching tag from cachedTags (e.g. "v1.2.3").
Types ¶
type ParsedImage ¶
type ParsedImage struct {
// The registry part of the image name without trailing slash.
// Example: ghcr.io
Registry string
// The part of the image name between Registry and BaseName without leading or trailing slashes.
// Example: kptdev/krm-functions-catalog
SubPath string
// The last part of the image name, after all slashes, without the leading slash.
// Example: apply-setters
BaseName string
// The tag of the image without the leading colon.
// Example: v0.2.3
Tag string
// The sha256 digest of the image, without the leading @, but containing the `sha256` prefix.
// Example: sha256:7d89a74f106241391f687fc2985c8e6de597bb21f0d0014def5edc730618d9cc
Digest string
// Original contains the unparsed image name. Intended for testing.
// Should be the same as the output of Full().
Original string
}
ParsedImage is a structured representation of a container image reference, broken into registry, sub-path, base name, tag, and digest components.
func Parse ¶
func Parse(fullImageName string) ParsedImage
Parse creates a ParsedImage object from the full image name. Does not guarantee that the input string is a valid reference, unlike regclientref.New().
func (*ParsedImage) Full ¶
func (p *ParsedImage) Full() string
Full reconstructs the full image name from the parsed parts.
func (*ParsedImage) Prefix ¶
func (p *ParsedImage) Prefix() string
Prefix returns the part before BaseName with *no* trailing slash.
func (*ParsedImage) String ¶
func (p *ParsedImage) String() string
Click to show internal directories.
Click to hide internal directories.