Documentation ¶
Index ¶
- func New(templateMods ...Modification) corev1.PodTemplateSpec
- func WithContainerByIndex(index int, funcs ...func(container *corev1.Container)) func(podTemplateSpec *corev1.PodTemplateSpec)
- func WithInitContainerByIndex(index int, funcs ...func(container *corev1.Container)) func(podTemplateSpec *corev1.PodTemplateSpec)
- type Modification
- func Apply(templateMods ...Modification) Modification
- func NOOP() Modification
- func WithAffinity(stsName, antiAffinityLabelKey string, weight int) Modification
- func WithAnnotations(annotations map[string]string) Modification
- func WithContainer(name string, containerfunc func(*corev1.Container)) Modification
- func WithFsGroup(fsGroup int) Modification
- func WithImagePullSecrets(name string) Modification
- func WithInitContainer(name string, containerfunc func(*corev1.Container)) Modification
- func WithNodeAffinity(nodeAffinity *corev1.NodeAffinity) Modification
- func WithPodAffinity(podAffinity *corev1.PodAffinity) Modification
- func WithPodLabels(labels map[string]string) Modification
- func WithServiceAccount(serviceAccountName string) Modification
- func WithTerminationGracePeriodSeconds(seconds int) Modification
- func WithTolerations(tolerations []corev1.Toleration) Modification
- func WithTopologyKey(topologyKey string, idx int) Modification
- func WithVolume(volume corev1.Volume) Modification
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 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