image

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstraintMatchMode added in v0.3.0

type ConstraintMatchMode int

ConstraintMatchMode defines how the constraint should be matched

const (
	// ConstraintMatchSemVer uses semver to match a constraint
	ConstraintMatchSemver ConstraintMatchMode = 0
	// ConstraintMatchRegExp uses regexp to match a constraint
	ConstraintMatchRegExp ConstraintMatchMode = 1
	// ConstraintMatchNone does not enforce a constraint
	ConstraintMatchNone ConstraintMatchMode = 2
)

type ContainerImage

type ContainerImage struct {
	RegistryURL           string
	ImageName             string
	ImageTag              *tag.ImageTag
	ImageAlias            string
	HelmParamImageName    string
	HelmParamImageVersion string
	// contains filtered or unexported fields
}

func NewFromIdentifier

func NewFromIdentifier(identifier string) *ContainerImage

NewFromIdentifier parses an image identifier and returns a populated ContainerImage

func (*ContainerImage) GetFullNameWithTag

func (img *ContainerImage) GetFullNameWithTag() string

func (*ContainerImage) GetFullNameWithoutTag

func (img *ContainerImage) GetFullNameWithoutTag() string

func (*ContainerImage) GetNewestVersionFromTags

func (img *ContainerImage) GetNewestVersionFromTags(vc *VersionConstraint, tagList *tag.ImageTagList) (*tag.ImageTag, error)

GetNewestVersionFromTags returns the latest available version from a list of tags while optionally taking a semver constraint into account. Returns the original version if no new version could be found from the list of tags.

func (*ContainerImage) GetParameterHelmImageName added in v0.3.0

func (img *ContainerImage) GetParameterHelmImageName(annotations map[string]string) string

GetParameterHelmImageName gets the value for image-name option for the image from a set of annotations

func (*ContainerImage) GetParameterHelmImageSpec added in v0.3.0

func (img *ContainerImage) GetParameterHelmImageSpec(annotations map[string]string) string

GetParameterHelmImageSpec gets the value for image-spec option for the image from a set of annotations

func (*ContainerImage) GetParameterHelmImageTag added in v0.3.0

func (img *ContainerImage) GetParameterHelmImageTag(annotations map[string]string) string

GetParameterHelmImageTag gets the value for image-tag option for the image from a set of annotations

func (*ContainerImage) GetParameterKustomizeImageName added in v0.3.0

func (img *ContainerImage) GetParameterKustomizeImageName(annotations map[string]string) string

GetParameterKustomizeImageName gets the value for image-spec option for the image from a set of annotations

func (*ContainerImage) GetParameterUpdateStrategy added in v0.3.0

func (img *ContainerImage) GetParameterUpdateStrategy(annotations map[string]string) VersionSortMode

GetParameterSort gets and validates the value for the sort option for the image from a set of annotations

func (*ContainerImage) IsUpdatable

func (img *ContainerImage) IsUpdatable(newTag, tagSpec string) bool

IsUpdatable checks whether the given image can be updated with newTag while taking tagSpec into account. tagSpec must be given as a semver compatible version spec, i.e. ^1.0 or ~2.1

func (*ContainerImage) Original

func (img *ContainerImage) Original() string

func (*ContainerImage) String

func (img *ContainerImage) String() string

String returns the string representation of given ContainerImage

func (*ContainerImage) WithTag

func (img *ContainerImage) WithTag(newTag *tag.ImageTag) *ContainerImage

WithTag returns a copy of img with new tag information set

type ContainerImageList

type ContainerImageList []*ContainerImage

func (*ContainerImageList) ContainsImage

func (list *ContainerImageList) ContainsImage(img *ContainerImage, checkVersion bool) *ContainerImage

ContainsImage checks whether img is contained in a list of images

func (*ContainerImageList) String

func (list *ContainerImageList) String() string

String Returns the name of all images as a string, seperated using comma

type Credential

type Credential struct {
	Username string
	Password string
}

type CredentialSource

type CredentialSource struct {
	Type            CredentialSourceType
	Registry        string
	SecretNamespace string
	SecretName      string
	SecretField     string
	EnvName         string
}

func ParseCredentialSource

func ParseCredentialSource(credentialSource string, requirePrefix bool) (*CredentialSource, error)

func (*CredentialSource) FetchCredentials

func (src *CredentialSource) FetchCredentials(registryURL string, kubeclient *client.KubernetesClient) (*Credential, error)

FetchCredentials fetches the credentials for a given registry according to the credential source.

type CredentialSourceType

type CredentialSourceType int
const (
	CredentialSourceUnknown    CredentialSourceType = 0
	CredentialSourcePullSecret CredentialSourceType = 1
	CredentialSourceSecret     CredentialSourceType = 2
	CredentialSourceEnv        CredentialSourceType = 3
)

type KustomizeImage

type KustomizeImage string

func (KustomizeImage) Match

func (i KustomizeImage) Match(j KustomizeImage) bool

if the image name matches (i.e. up to the first delimiter)

type KustomizeImages

type KustomizeImages []KustomizeImage

func (KustomizeImages) Find

func (images KustomizeImages) Find(image KustomizeImage) int

find the image or -1

type VersionConstraint added in v0.3.0

type VersionConstraint struct {
	Constraint string
	MatchMode  ConstraintMatchMode
	SortMode   VersionSortMode
}

VersionConstraint defines a constraint for comparing versions

func (*VersionConstraint) String added in v0.3.0

func (vc *VersionConstraint) String() string

String returns the string representation of VersionConstraint

type VersionSortMode added in v0.3.0

type VersionSortMode int

VersionSortMode defines the method to sort a list of tags

const (
	// VersionSortSemVer sorts tags using semver sorting (the default)
	VersionSortSemVer VersionSortMode = 0
	// VersionSortLatest sorts tags after their creation date
	VersionSortLatest VersionSortMode = 1
	// VersionSortName sorts tags alphabetically by name
	VersionSortName VersionSortMode = 2
)

Jump to

Keyboard shortcuts

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