testing

package
v1.31.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeContainer

func MakeContainer(name string, tweaks ...TweakContainer) api.Container

func MakeEmptyVolume

func MakeEmptyVolume(name string) api.Volume

func MakePod

func MakePod(name string, tweaks ...Tweak) *api.Pod

MakePod helps construct Pod objects (which pass API validation) more legibly and tersely than a Go struct definition. By default this produces a Pod with a single container, ctr. The caller can pass any number of tweak functions to further modify the result.

func MakePodSpec

func MakePodSpec(tweaks ...Tweak) api.PodSpec

func MakeResourceRequirements

func MakeResourceRequirements(requests, limits map[string]string) api.ResourceRequirements

Types

type Tweak

type Tweak func(*api.Pod)

Tweak is a function that modifies a Pod.

func SetActiveDeadlineSeconds

func SetActiveDeadlineSeconds(deadline int64) Tweak

func SetAffinity

func SetAffinity(affinity *api.Affinity) Tweak

func SetAnnotations

func SetAnnotations(annos map[string]string) Tweak

func SetContainers

func SetContainers(containers ...api.Container) Tweak

func SetDNSPolicy

func SetDNSPolicy(policy api.DNSPolicy) Tweak

func SetEphemeralContainers

func SetEphemeralContainers(containers ...api.EphemeralContainer) Tweak

func SetHostAliases

func SetHostAliases(hostAliases ...api.HostAlias) Tweak

func SetInitContainers

func SetInitContainers(containers ...api.Container) Tweak

func SetLabels

func SetLabels(annos map[string]string) Tweak

func SetNamespace

func SetNamespace(ns string) Tweak

func SetNodeName

func SetNodeName(name string) Tweak

func SetNodeSelector

func SetNodeSelector(nodeSelector map[string]string) Tweak

func SetOS

func SetOS(name api.OSName) Tweak

func SetObjectMeta

func SetObjectMeta(objectMeta metav1.ObjectMeta) Tweak

func SetOverhead

func SetOverhead(overhead api.ResourceList) Tweak

func SetPriorityClassName

func SetPriorityClassName(name string) Tweak

func SetResourceClaims

func SetResourceClaims(claims ...api.PodResourceClaim) Tweak

func SetResourceVersion

func SetResourceVersion(rv string) Tweak

func SetRestartPolicy

func SetRestartPolicy(policy api.RestartPolicy) Tweak

func SetRuntimeClassName

func SetRuntimeClassName(name string) Tweak

func SetSchedulingGates

func SetSchedulingGates(gates ...api.PodSchedulingGate) Tweak

func SetSecurityContext

func SetSecurityContext(ctx *api.PodSecurityContext) Tweak

func SetServiceAccountName

func SetServiceAccountName(name string) Tweak

func SetStatus

func SetStatus(status api.PodStatus) Tweak

func SetTerminationGracePeriodSeconds

func SetTerminationGracePeriodSeconds(grace int64) Tweak

func SetTolerations

func SetTolerations(tolerations ...api.Toleration) Tweak

func SetTopologySpreadConstraints

func SetTopologySpreadConstraints(tsc ...api.TopologySpreadConstraint) Tweak

func SetVolumes

func SetVolumes(volumes ...api.Volume) Tweak

type TweakContainer

type TweakContainer func(*api.Container)

func SetContainerImage

func SetContainerImage(image string) TweakContainer

func SetContainerPorts

func SetContainerPorts(ports ...api.ContainerPort) TweakContainer

func SetContainerResizePolicy

func SetContainerResizePolicy(policies ...api.ContainerResizePolicy) TweakContainer

func SetContainerResources

func SetContainerResources(rr api.ResourceRequirements) TweakContainer

func SetContainerRestartPolicy

func SetContainerRestartPolicy(policy api.ContainerRestartPolicy) TweakContainer

func SetContainerSecurityContext

func SetContainerSecurityContext(ctx api.SecurityContext) TweakContainer

Jump to

Keyboard shortcuts

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