images

package
v1.7.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultRegistry          = "docker.io"
	DockerOfficialRepository = "library"
)

Variables

This section is empty.

Functions

func CollectPullSecrets

func CollectPullSecrets(images ...*Image) []corev1.LocalObjectReference

CollectPullSecrets returns a slice of secret references required to pull all the given images. The slice will be empty if none of the images requires a secret to be successfully pulled.

Types

type Image

type Image struct {

	// The Docker registry to use. Defaults to "docker.io", the official Docker Hub.
	// +kubebuilder:default="docker.io"
	// +optional
	Registry string `json:"registry,omitempty"`

	// The Docker repository to use.
	// +optional
	Repository string `json:"repository,omitempty"`

	// The image name to use.
	// +optional
	Name string `json:"name,omitempty"`

	// The image tag to use. Defaults to "latest".
	// +kubebuilder:default="latest"
	// +optional
	Tag string `json:"tag,omitempty"`

	// The image pull policy to use. Defaults to "Always" if the tag is "latest", otherwise to "IfNotPresent".
	// +optional
	// +kubebuilder:validation:Enum:=Always;IfNotPresent;Never
	PullPolicy corev1.PullPolicy `json:"pullPolicy,omitempty"`

	// The secret to use when pulling the image from private repositories. If specified, this secret will be passed to
	// individual puller implementations for them to use. For example, in the case of Docker, only DockerConfig type
	// secrets are honored. More info:
	// https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
	// +optional
	PullSecretRef *corev1.LocalObjectReference `json:"pullSecretRef,omitempty"`
}

Image uniquely describes a container image and also specifies how to pull it from its remote repository. More info: https://kubernetes.io/docs/concepts/containers/images. +kubebuilder:object:generate=true

func (*Image) ApplyDefaults

func (in *Image) ApplyDefaults(defaults Image) *Image

ApplyDefaults returns a new Image built by coalescing this image with the given image; defaults from the given image are used for components that were not explicitly provided in this image. The registry is computed as follows: if the image specifies a registry, that registry is returned; otherwise, if the default image specifies a registry, that registry is returned; otherwise, the default registry is returned. The tag is computed as follows: if the image specifies a tag, that tag is returned; otherwise, if the default image specifies a tag, that tag is returned; otherwise, "latest" returned. The pull policy is computed as follows: if the image specifies a pull policy, that policy is returned; otherwise, if the image tag is "latest", Always is returned; otherwise, the default pull policy is returned. Other components are computed as follows: if the image specifies a (non-empty) component, that component is returned; otherwise, the component from the default image is returned.

func (*Image) DeepCopy

func (in *Image) DeepCopy() *Image

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image.

func (*Image) DeepCopyInto

func (in *Image) DeepCopyInto(out *Image)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Image) String

func (in Image) String() string

String returns this image's Docker name. It does not validate that the returned name is a valid Docker name.

Jump to

Keyboard shortcuts

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