glob

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ResolvedDockerhubHost = "index.docker.io/"
	// Images such as "busybox" reside in the dockerhub "library" repository
	// The full resolved image reference would be index.docker.io/library/busybox
	DockerhubPublicRepository = "library/"
)

Variables

This section is empty.

Functions

func Compile

func Compile(glob string) (*regexp.Regexp, error)

Compile attempts to normalize the glob and turn it into a regular expression that we can use for matching image names.

func Match

func Match(glob, image string) (bool, error)

Match will return true if the image reference matches the requested glob pattern.

If the image reference is invalid, an error will be returned.

In the glob pattern, the "*" character matches any non-"/" character, and "**" matches any character, including "/".

If the image is a DockerHub official image like "ubuntu" or "debian", the glob that matches it must be something like index.docker.io/library/ubuntu. If the image is a DockerHub used-owned image like "myuser/myapp", then the glob that matches it must be something like index.docker.io/myuser/myapp. This means that the glob patterns "*" will not match the image name "ubuntu", and "*/*" will not match "myuser/myapp"; the "index.docker.io" prefix is required.

If the image does not specify a tag (e.g., :latest or :v1.2.3), the tag ":latest" will be assumed.

Note that the tag delimiter (":") does not act as a breaking separator for the purposes of a "*" glob. To match any tag, the glob should end with ":**".

Types

This section is empty.

Jump to

Keyboard shortcuts

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