image

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeURL added in v1.6.0

func NormalizeURL(repoURL string) string

NormalizeURL normalizes image repository URLs. Notably, hostnames docker.io and index.docker.io, if present, are dropped. The optional /library prefix for official images from Docker Hub, if included, is also dropped. Valid, non-Docker Hub repository URLs will be returned unchanged.

This is useful for the purposes of comparison and also in cases where a canonical representation of a repository URL is needed. Any URL that cannot be normalized will be returned as-is.

func ValidatePlatformConstraint

func ValidatePlatformConstraint(platformStr string) bool

ValidatePlatformConstraint returns a boolean indicating whether the provided platform constraint string is valid.

Types

type Credentials

type Credentials struct {
	// Username identifies a principal, which combined with the value of the
	// Password field, can be used for reading from some image repository.
	Username string
	// Password, when combined with the principal identified by the Username
	// field, can be used for reading from some image repository.
	Password string
}

Credentials represents the credentials for connecting to a private image repository.

type Selector added in v0.4.0

type Selector interface {
	// MatchesTag returns a boolean value indicating whether or not the Selector
	// would consider an image with the specified tag eligible for selection.
	MatchesTag(string) bool
	// Select selects images from a container image repository.
	Select(context.Context) ([]kargoapi.DiscoveredImageReference, error)
}

Selector is an interface for selecting images from a container image repository.

func NewSelector added in v0.4.0

func NewSelector(
	sub kargoapi.ImageSubscription,
	creds *Credentials,
) (Selector, error)

NewSelector returns some implementation of the Selector interface that selects images from a container image repository based on the provided subscription.

Jump to

Keyboard shortcuts

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