Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindBestSemverMatch ¶
FindBestSemverMatch returns the highest semantic-version tag in cachedTags that satisfies constraint, preserving the original tag string (e.g. "v1.2.3"). Entries that cannot be parsed as semantic versions are ignored.
func MatchesAnyConstraint ¶
func WithPrefix ¶
WithPrefix prepends prefix to a name that contains no slash. An empty prefix, or a name that already contains a slash, is returned unchanged.
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 stores an OCI image name split into all of its 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) Repository ¶
func (p ParsedImage) Repository() string
Repository is the image name without a tag or digest.