Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidatePlatformConstraint ¶
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 Image ¶ added in v0.4.0
type Image struct { Tag string Digest string CreatedAt *time.Time // contains filtered or unexported fields }
Image is a representation of a container image.
type SelectionStrategy ¶ added in v0.4.0
type SelectionStrategy string
SelectionStrategy represents a strategy for selecting a single image from a container image repository.
const ( // SelectionStrategyDigest represents an image selection strategy that is // useful for finding the digest of a container image that is currently // referenced by a mutable tag, e.g. latest. This strategy requires the use of // a constraint that must exactly match the name of a, presumably, mutable // tag. SelectionStrategyDigest SelectionStrategy = "Digest" // SelectionStrategyLexical represents an image selection strategy that is // useful for finding the the image referenced by the tag that is lexically // last among those matched by a regular expression and not explicitly // ignored. This strategy is useful for finding the images referenced by the // latest in a series of tag that are suffixed with a predictably formatted // timestamp. SelectionStrategyLexical SelectionStrategy = "Lexical" // SelectionStrategyNewestBuild represents an image selection strategy that is // useful for finding the image that was most recently pushed to the image // repository. This is the least efficient strategy because it can require the // retrieval of many manifests from the image repository. It is best to use // this strategy with caution and constrain the eligible tags as much as // possible using a regular expression. SelectionStrategyNewestBuild SelectionStrategy = "NewestBuild" // SelectionStrategySemVer represents an image selection strategy that is // useful for finding the images referenced by the tag is the highest among // tags from the repository that are valid semantic versions. An optional // constraint can limit the eligible range of semantic versions. SelectionStrategySemVer SelectionStrategy = "SemVer" )
type Selector ¶ added in v0.4.0
type Selector interface { // Select selects a single image from a container image repository. Select(context.Context) ([]Image, error) }
Selector is an interface for selecting images from a container image repository.
func NewSelector ¶ added in v0.4.0
func NewSelector( repoURL string, strategy SelectionStrategy, opts *SelectorOptions, ) (Selector, error)
NewSelector returns some implementation of the Selector interface that selects a single image from a container image repository based on a selection strategy and a set of optional constraints.
type SelectorOptions ¶ added in v0.4.0
type SelectorOptions struct { // Constraint holds a selection strategy-specific value for constraining image // selection. Constraint string // AllowRegex is an optional regular expression that can be used to constrain // image selection based on eligible tags. AllowRegex string // Ignore is an optional list of tags that should explicitly be ignored when // selecting an image. Ignore []string // Platform is an optional platform constraint. If specified, the selected // image must match the platform constraint or Selector implementations will // return nil. Platform string // Creds holds optional credentials for authenticating to the image // repository. Creds *Credentials // InsecureSkipTLSVerify is an optional flag, that if set to true, will // disable verification of the image repository's TLS certificate. InsecureSkipTLSVerify bool // DiscoveryLimit is an optional limit on the number of images that can be // discovered by the Selector. The limit is applied after filtering images // based on the AllowRegex and Ignore fields. If the limit is zero, all // discovered images will be returned. DiscoveryLimit int }
SelectorOptions represents options for creating a Selector.