imagespec

package
v0.0.0-...-c49e678 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitImageSpec

func SplitImageSpec(image string) (registry, repo, tag, label, ctx string)

SplitImageSpec splits the given image specification into the various components of an ImageSpec

func SplitLabelContext

func SplitLabelContext(labelCtx string) (label, ctx string)

SplitLabelContext splits labelCtx into Label and Context (the part after "@", see sepLabelContext)

FIXME: image@sha256:<sha256> is called image-by-digest. obviously this collides with the concept of "concept". either fix the concept / implementation of "a context" (which helps to remap the found container-images to the runnable entities they might refer to) OR detect a image-by-digest and ignore it coz we can't really compare such a digest against "newer"

func SplitRegistryRepo

func SplitRegistryRepo(regrepo string) (registry, repotag string)

SplitRegistryRepo splits regrepo into registry and the repo, eg: "quay.io/project/repo" into "quay.io" and "project/repo"

func SplitRepoTag

func SplitRepoTag(repotag string) (repo, tag string)

SplitRepoTag splits a string which contains a repo and a tag combination. SplitRepoTag("repo/image:tag-label") * repo: "repo/image" * tag: "tag-label"

func SplitTagLabel

func SplitTagLabel(taglabel string) (tag, label string)

SplitTagLabel splits taglabel into tag and label, eg: 1.0-label into "1.0" and "label"

Types

type List

type List []*Spec

List defines a list of ImageSpecs

type Spec

type Spec struct {
	Registry string
	Repo     string
	Tag      string
	Label    string
	Context  string
}

Spec describes a container image spec.

A container-image name is constructed from several pieces:

docker.io/library/alpine:1.13-rc0-amd64+12345 ^-+-----^ ^--+--^ ^--+-^ ^-+^ ^+------^ ^-+-^

|          |       |     |   |          |
+- registry|       |     |   |          |
           +- repository |   |          |
                         |   |          |

 ····· semver ···································

|   |          |
+- version     |
|   |          |
|   +- pre-release
|              |
|              +- build

····· other ····································

|
+- label

relevant links:

* short names: https://github.com/containers/shortnames

func Parse

func Parse(name string) (*Spec, error)

Parse parses the given name into an ImageSpec

func (*Spec) Normalize

func (spec *Spec) Normalize() *Spec

Normalize tries to transform a short image name into a normalized form A short image name is something like "alpine" which totally lacks the registry part.

func (*Spec) RegistryRepo

func (spec *Spec) RegistryRepo() string

RegistryRepo returns a string based upon the registry and the repo component of spec

func (*Spec) String

func (spec *Spec) String() string

String satisfies the Stringer interface

func (*Spec) StripContext

func (spec *Spec) StripContext() *Spec

StripContext removes the context component of spec. The function returns a new ImageSpec

Jump to

Keyboard shortcuts

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