podtemplatespec

package
v0.0.8-prerelease Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(templateMods ...Modification) corev1.PodTemplateSpec

func WithContainerByIndex

func WithContainerByIndex(index int, funcs ...func(container *corev1.Container)) func(podTemplateSpec *corev1.PodTemplateSpec)

WithContainerByIndex applies the modifications to the container with the provided index if the index is out of range, a new container is added to accept these changes.

func WithInitContainerByIndex

func WithInitContainerByIndex(index int, funcs ...func(container *corev1.Container)) func(podTemplateSpec *corev1.PodTemplateSpec)

WithInitContainerByIndex applies the modifications to the container with the provided index if the index is out of range, a new container is added to accept these changes.

Types

type Modification

type Modification func(*corev1.PodTemplateSpec)

func Apply

func Apply(templateMods ...Modification) Modification

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

func NOOP

func NOOP() Modification

NOOP is a valid Modification which applies no changes

func WithAffinity

func WithAffinity(stsName, antiAffinityLabelKey string, weight int) Modification

WithAffinity updates the name, antiAffinityLabelKey and weight of the PodTemplateSpec's Affinity

func WithAnnotations

func WithAnnotations(annotations map[string]string) Modification

WithAnnotations sets the PodTemplateSpec's annotations

func WithContainer

func WithContainer(name string, containerfunc func(*corev1.Container)) Modification

WithContainer applies the modifications to the container with the provided name

func WithFsGroup

func WithFsGroup(fsGroup int) Modification

WithFsGroup sets the PodTemplateSpec's fs group

func WithImagePullSecrets

func WithImagePullSecrets(name string) Modification

WithImagePullSecrets adds an ImagePullSecrets local reference with the given name

func WithInitContainer

func WithInitContainer(name string, containerfunc func(*corev1.Container)) Modification

WithInitContainer applies the modifications to the init container with the provided name

func WithNodeAffinity

func WithNodeAffinity(nodeAffinity *corev1.NodeAffinity) Modification

WithNodeAffinity sets the PodTemplateSpec's node affinity

func WithPodAffinity

func WithPodAffinity(podAffinity *corev1.PodAffinity) Modification

WithPodAffinity sets the PodTemplateSpec's pod affinity

func WithPodLabels

func WithPodLabels(labels map[string]string) Modification

WithPodLabels sets the PodTemplateSpec's Labels

func WithServiceAccount

func WithServiceAccount(serviceAccountName string) Modification

WithServiceAccount sets the PodTemplateSpec's ServiceAccount name

func WithTerminationGracePeriodSeconds

func WithTerminationGracePeriodSeconds(seconds int) Modification

WithTerminationGracePeriodSeconds sets the PodTemplateSpec's termination grace period seconds

func WithTolerations

func WithTolerations(tolerations []corev1.Toleration) Modification

WithTolerations sets the PodTemplateSpec's tolerations

func WithTopologyKey

func WithTopologyKey(topologyKey string, idx int) Modification

WithTopologyKey sets the PodTemplateSpec's topology at a given index

func WithVolume

func WithVolume(volume corev1.Volume) Modification

WithVolume ensures the given volume exists

Jump to

Keyboard shortcuts

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