imageutil

package
v0.0.0-...-f8abdcd Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultImageTag is used when an image tag is needed and the configuration does not specify a tag to use.
	DefaultImageTag = "latest"
)

Variables

Functions

func DigestOrImageMatch

func DigestOrImageMatch(image, imageID string) bool

DigestOrImageMatch matches the digest in the image name.

func ImageWithMetadata

func ImageWithMetadata(image *imagev1.Image) error

ImageWithMetadata mutates the given image. It parses raw DockerImageManifest data stored in the image and fills its DockerImageMetadata and other fields. Copied from github.com/openshift/image-registry/pkg/origin-common/util/util.go

func ImageWithMetadataOrDie

func ImageWithMetadataOrDie(image *imagev1.Image)

func JoinImageStreamImage

func JoinImageStreamImage(name, id string) string

JoinImageStreamImage creates a name for image stream image object from an image stream name and an id.

func JoinImageStreamTag

func JoinImageStreamTag(name, tag string) string

JoinImageStreamTag turns a name and tag into the name of an ImageStreamTag

func LatestTaggedImage

func LatestTaggedImage(stream *imagev1.ImageStream, tag string) *imagev1.TagEvent

LatestTaggedImage returns the most recent TagEvent for the specified image repository and tag. Will resolve lookups for the empty tag. Returns nil if tag isn't present in stream.status.tags.

func ParseDockerImageReference

func ParseDockerImageReference(spec string) (imagev1.DockerImageReference, error)

ParseDockerImageReference parses a Docker pull spec string into a DockerImageReference.

func ParseImageStreamImageName

func ParseImageStreamImageName(input string) (name string, id string, err error)

ParseImageStreamImageName splits a string into its name component and ID component, and returns an error if the string is not in the right form.

func ParseImageStreamTagName

func ParseImageStreamTagName(istag string) (name string, tag string, err error)

ParseImageStreamTagName splits a string into its name component and tag component, and returns an error if the string is not in the right form.

func PrioritizeTags

func PrioritizeTags(tags []string)

PrioritizeTags orders a set of image tags with a few conventions:

1. the "latest" tag, if present, should be first 2. any tags that represent a semantic minor version ("5.1", "v5.1", "v5.1-rc1") should be next, in descending order 3. any tags that represent a full semantic version ("5.1.3-other", "v5.1.3-other") should be next, in descending order 4. any remaining tags should be sorted in lexicographic order

The method updates the tags in place.

func ResolveLatestTaggedImage

func ResolveLatestTaggedImage(stream *imagev1.ImageStream, tag string) (string, bool)

ResolveLatestTaggedImage returns the appropriate pull spec for a given tag in the image stream, handling the tag's reference policy if necessary to return a resolved image. Callers that transform an ImageStreamTag into a pull spec should use this method instead of LatestTaggedImage.

func SpecHasTag

func SpecHasTag(stream *imagev1.ImageStream, name string) (imagev1.TagReference, bool)

SpecHasTag returns named tag from image stream's spec and boolean whether one was found.

func SplitImageStreamImage

func SplitImageStreamImage(nameAndID string) (name string, id string, ok bool)

SplitImageStreamImage turns the name of an ImageStreamImage into Name and ID. It returns false if the ID was not properly specified in the name.

func SplitImageStreamTag

func SplitImageStreamTag(nameAndTag string) (name string, tag string, ok bool)

SplitImageStreamTag turns the name of an ImageStreamTag into Name and Tag. It returns false if the tag was not properly specified in the name.

func StatusHasTag

func StatusHasTag(stream *imagev1.ImageStream, name string) (imagev1.NamedTagEventList, bool)

StatusHasTag returns named tag from image stream's status and boolean whether one was found.

Types

This section is empty.

Jump to

Keyboard shortcuts

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