container

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(mods ...Modification) corev1.Container

New returns a concrete corev1.Container instance which has been modified based on the provided modifications

Types

type Modification

type Modification func(*corev1.Container)

func Apply

func Apply(modifications ...Modification) Modification

Apply returns a function which applies a series of Modification functions to a *corev1.Container

func NOOP

func NOOP() Modification

NOOP is a valid Modification which applies no changes

func WithCommand

func WithCommand(cmd []string) Modification

WithCommand sets the containers Command

func WithEnvs

func WithEnvs(envs ...corev1.EnvVar) Modification

WithEnvs ensures all of the provided envs exist in the container

func WithImage

func WithImage(image string) Modification

WithImage sets the container image

func WithImagePullPolicy

func WithImagePullPolicy(pullPolicy corev1.PullPolicy) Modification

WithImagePullPolicy sets the container pullPolicy

func WithLifecycle

func WithLifecycle(lifeCycleMod lifecycle.Modification) Modification

WithLifecycle applies the lifecycle Modification to this container's Lifecycle

func WithLivenessProbe

func WithLivenessProbe(readinessProbeFunc func(*corev1.Probe)) Modification

WithLivenessProbe modifies the container's Liveness Probe

func WithName

func WithName(name string) Modification

WithName sets the container name

func WithPorts

func WithPorts(ports []corev1.ContainerPort) Modification

WithPorts sets the container's Ports

func WithReadinessProbe

func WithReadinessProbe(probeFunc func(*corev1.Probe)) Modification

WithReadinessProbe modifies the container's Readiness Probe

func WithResourceRequirements

func WithResourceRequirements(resources corev1.ResourceRequirements) Modification

WithResourceRequirements sets the container's Resources

func WithSecurityContext

func WithSecurityContext(context corev1.SecurityContext) Modification

WithSecurityContext sets teh container's SecurityContext

func WithVolumeMounts

func WithVolumeMounts(volumeMounts []corev1.VolumeMount) Modification

WithVolumeMounts sets the VolumeMounts

Jump to

Keyboard shortcuts

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