imagevector

package
v0.0.0-...-32fc51b Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	Name       string
	Repository string
	Tag        string
}

Image is a concrete, pullable image with a nonempty tag.

func (*Image) String

func (i *Image) String() string

String will returns the string representation of the image.

type ImageSource

type ImageSource struct {
	Name       string `json:"name" yaml:"name"`
	Repository string `json:"repository" yaml:"repository"`
	Tag        string `json:"tag" yaml:"tag"`
	Versions   string `json:"versions" yaml:"versions"`
}

ImageSource contains the repository and the tag of a Docker container image. If the respective image is only valid for a specific Kubernetes version, then it must also contain the 'versions' field describing for which versions it can be used.

func (*ImageSource) ToImage

func (i *ImageSource) ToImage(targetK8sVersion string) *Image

ToImage applies the given <targetK8sVersion> to the source to produce an output image. If the tag of an image source is empty, it will use the given <k8sVersion> as tag.

type ImageVector

type ImageVector []*ImageSource

ImageVector is a list of image sources.

func ReadImageVector

func ReadImageVector() (ImageVector, error)

ReadImageVector reads the image.yaml in the chart directory, unmarshals it into a []*ImageSource type and returns it.

func (ImageVector) FindImage

func (v ImageVector) FindImage(name, k8sVersionRuntime, k8sVersionTarget string) (*Image, error)

FindImage returns an image with the given <name> from the sources in the image vector. The <k8sVersion> specifies the kubernetes version the image will be running on. The <targetK8sVersion> specifies the kubernetes version the image shall target. If multiple entries were found, the provided <k8sVersion> is compared with the constraints stated in the image definition. In case multiple images match the search, the first which was found is returned. In case no image was found, an error is returned.

Jump to

Keyboard shortcuts

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