testing

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeNodesAndPodsForEvenPodsSpread added in v1.17.0

func MakeNodesAndPodsForEvenPodsSpread(labels map[string]string, existingPodsNum, allNodesNum, filteredNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node, filteredNodes []*v1.Node)

MakeNodesAndPodsForEvenPodsSpread serves as a testing helper for EvenPodsSpread feature. It builds a fake cluster containing running Pods and Nodes. The size of Pods and Nodes are determined by input arguments. The specs of Pods and Nodes are generated with the following rules:

  • Each generated node is applied with a unique label: "node: node<i>".
  • Each generated node is applied with a rotating label: "zone: zone[0-9]".
  • Depending on the input labels, each generated pod will be applied with label "key1", "key1,key2", ..., "key1,key2,...,keyN" in a rotating manner.

Types

type ContainerWrapper added in v1.25.0

type ContainerWrapper struct{ v1.Container }

ContainerWrapper wraps a Container inside.

func MakeContainer added in v1.25.0

func MakeContainer() *ContainerWrapper

MakeContainer creates a Container wrapper.

func (*ContainerWrapper) ContainerPort added in v1.25.0

func (c *ContainerWrapper) ContainerPort(ports []v1.ContainerPort) *ContainerWrapper

ContainerPort sets `ports` as the ports of the inner Container.

func (*ContainerWrapper) HostPort added in v1.25.0

func (c *ContainerWrapper) HostPort(hostPort int32) *ContainerWrapper

HostPort sets `hostPort` as the host port of the inner Container.

func (*ContainerWrapper) Image added in v1.25.0

func (c *ContainerWrapper) Image(image string) *ContainerWrapper

Image sets `image` as the image of the inner Container.

func (*ContainerWrapper) Name added in v1.25.0

Name sets `n` as the name of the inner Container.

func (*ContainerWrapper) Obj added in v1.25.0

func (c *ContainerWrapper) Obj() v1.Container

Obj returns the inner Container.

func (*ContainerWrapper) ResourceLimits added in v1.27.0

func (c *ContainerWrapper) ResourceLimits(limMap map[v1.ResourceName]string) *ContainerWrapper

ResourceLimits sets the container resource limits to the given resource map.

func (*ContainerWrapper) ResourceRequests added in v1.27.0

func (c *ContainerWrapper) ResourceRequests(reqMap map[v1.ResourceName]string) *ContainerWrapper

ResourceRequests sets the container resources requests to the given resource map of requests.

func (*ContainerWrapper) Resources added in v1.25.0

func (c *ContainerWrapper) Resources(resMap map[v1.ResourceName]string) *ContainerWrapper

Resources sets the container resources to the given resource map.

type LabelSelectorWrapper added in v1.16.0

type LabelSelectorWrapper struct{ metav1.LabelSelector }

LabelSelectorWrapper wraps a LabelSelector inside.

func MakeLabelSelector added in v1.16.0

func MakeLabelSelector() *LabelSelectorWrapper

MakeLabelSelector creates a LabelSelector wrapper.

func (*LabelSelectorWrapper) Exists added in v1.16.0

Exists injects a matchExpression (with an operator Exists) to the inner labelSelector.

func (*LabelSelectorWrapper) In added in v1.16.0

In injects a matchExpression (with an operator In) to the inner labelSelector.

func (*LabelSelectorWrapper) Label added in v1.16.0

Label applies a {k,v} pair to the inner LabelSelector.

func (*LabelSelectorWrapper) NotExist added in v1.16.0

NotExist injects a matchExpression (with an operator NotExist) to the inner labelSelector.

func (*LabelSelectorWrapper) NotIn added in v1.16.0

func (s *LabelSelectorWrapper) NotIn(key string, vals []string) *LabelSelectorWrapper

NotIn injects a matchExpression (with an operator NotIn) to the inner labelSelector.

func (*LabelSelectorWrapper) Obj added in v1.16.0

Obj returns the inner LabelSelector.

type NodeSelectorWrapper added in v1.16.0

type NodeSelectorWrapper struct{ v1.NodeSelector }

NodeSelectorWrapper wraps a NodeSelector inside.

func MakeNodeSelector added in v1.16.0

func MakeNodeSelector() *NodeSelectorWrapper

MakeNodeSelector creates a NodeSelector wrapper.

func (*NodeSelectorWrapper) In added in v1.16.0

In injects a matchExpression (with an operator IN) as a selectorTerm to the inner nodeSelector. NOTE: appended selecterTerms are ORed.

func (*NodeSelectorWrapper) NotIn added in v1.16.0

func (s *NodeSelectorWrapper) NotIn(key string, vals []string) *NodeSelectorWrapper

NotIn injects a matchExpression (with an operator NotIn) as a selectorTerm to the inner nodeSelector.

func (*NodeSelectorWrapper) Obj added in v1.16.0

Obj returns the inner NodeSelector.

type NodeWrapper added in v1.16.0

type NodeWrapper struct{ v1.Node }

NodeWrapper wraps a Node inside.

func MakeNode added in v1.16.0

func MakeNode() *NodeWrapper

MakeNode creates a Node wrapper.

func (*NodeWrapper) Annotation added in v1.30.0

func (n *NodeWrapper) Annotation(k, v string) *NodeWrapper

Annotation applies a {k,v} annotation pair to the inner node.

func (*NodeWrapper) Capacity added in v1.19.0

func (n *NodeWrapper) Capacity(resources map[v1.ResourceName]string) *NodeWrapper

Capacity sets the capacity and the allocatable resources of the inner node. Each entry in `resources` corresponds to a resource name and its quantity. By default, the capacity and allocatable number of pods are set to 32.

func (*NodeWrapper) Condition added in v1.30.0

func (n *NodeWrapper) Condition(typ v1.NodeConditionType, status v1.ConditionStatus, message, reason string) *NodeWrapper

Condition applies the node condition.

func (*NodeWrapper) Images added in v1.19.0

func (n *NodeWrapper) Images(images map[string]int64) *NodeWrapper

Images sets the images of the inner node. Each entry in `images` corresponds to an image name and its size in bytes.

func (*NodeWrapper) Label added in v1.16.0

func (n *NodeWrapper) Label(k, v string) *NodeWrapper

Label applies a {k,v} label pair to the inner node.

func (*NodeWrapper) Name added in v1.16.0

func (n *NodeWrapper) Name(s string) *NodeWrapper

Name sets `s` as the name of the inner pod.

func (*NodeWrapper) Obj added in v1.16.0

func (n *NodeWrapper) Obj() *v1.Node

Obj returns the inner Node.

func (*NodeWrapper) Taints added in v1.21.13

func (n *NodeWrapper) Taints(taints []v1.Taint) *NodeWrapper

Taints applies taints to the inner node.

func (*NodeWrapper) UID added in v1.18.0

func (n *NodeWrapper) UID(s string) *NodeWrapper

UID sets `s` as the UID of the inner pod.

func (*NodeWrapper) Unschedulable added in v1.30.0

func (n *NodeWrapper) Unschedulable(unschedulable bool) *NodeWrapper

Unschedulable applies the unschedulable field.

type PersistentVolumeClaimWrapper added in v1.26.0

type PersistentVolumeClaimWrapper struct{ v1.PersistentVolumeClaim }

PersistentVolumeClaimWrapper wraps a PersistentVolumeClaim inside.

func MakePersistentVolumeClaim added in v1.26.0

func MakePersistentVolumeClaim() *PersistentVolumeClaimWrapper

MakePersistentVolumeClaim creates a PersistentVolumeClaim wrapper.

func (*PersistentVolumeClaimWrapper) AccessModes added in v1.26.0

AccessModes sets `accessModes` as the access modes of the inner PersistentVolumeClaim.

func (*PersistentVolumeClaimWrapper) Annotation added in v1.26.0

Annotation sets a {k,v} pair to the inner PersistentVolumeClaim.

func (*PersistentVolumeClaimWrapper) Name added in v1.26.0

Name sets `s` as the name of the inner PersistentVolumeClaim.

func (*PersistentVolumeClaimWrapper) Namespace added in v1.26.0

Namespace sets `s` as the namespace of the inner PersistentVolumeClaim.

func (*PersistentVolumeClaimWrapper) Obj added in v1.26.0

Obj returns the inner PersistentVolumeClaim.

func (*PersistentVolumeClaimWrapper) Resources added in v1.26.0

Resources sets `resources` as the resource requirements of the inner PersistentVolumeClaim.

func (*PersistentVolumeClaimWrapper) VolumeName added in v1.26.0

VolumeName sets `name` as the volume name of the inner PersistentVolumeClaim.

type PersistentVolumeWrapper added in v1.26.0

type PersistentVolumeWrapper struct{ v1.PersistentVolume }

PersistentVolumeWrapper wraps a PersistentVolume inside.

func MakePersistentVolume added in v1.26.0

func MakePersistentVolume() *PersistentVolumeWrapper

MakePersistentVolume creates a PersistentVolume wrapper.

func (*PersistentVolumeWrapper) AccessModes added in v1.26.0

AccessModes sets `accessModes` as the access modes of the inner PersistentVolume.

func (*PersistentVolumeWrapper) Capacity added in v1.26.0

Capacity sets `capacity` as the resource list of the inner PersistentVolume.

func (*PersistentVolumeWrapper) HostPathVolumeSource added in v1.26.0

HostPathVolumeSource sets `src` as the host path volume source of the inner PersistentVolume.

func (*PersistentVolumeWrapper) Name added in v1.26.0

Name sets `s` as the name of the inner PersistentVolume.

func (*PersistentVolumeWrapper) NodeAffinityIn added in v1.27.14

func (p *PersistentVolumeWrapper) NodeAffinityIn(key string, vals []string) *PersistentVolumeWrapper

NodeAffinityIn creates a HARD node affinity (with the operator In) and injects into the pv.

func (*PersistentVolumeWrapper) Obj added in v1.26.0

Obj returns the inner PersistentVolume.

type PodAffinityKind added in v1.17.0

type PodAffinityKind int

PodAffinityKind represents different kinds of PodAffinity.

const (
	// NilPodAffinity is a no-op which doesn't apply any PodAffinity.
	NilPodAffinity PodAffinityKind = iota
	// PodAffinityWithRequiredReq applies a HARD requirement to pod.spec.affinity.PodAffinity.
	PodAffinityWithRequiredReq
	// PodAffinityWithPreferredReq applies a SOFT requirement to pod.spec.affinity.PodAffinity.
	PodAffinityWithPreferredReq
	// PodAffinityWithRequiredPreferredReq applies HARD and SOFT requirements to pod.spec.affinity.PodAffinity.
	PodAffinityWithRequiredPreferredReq
	// PodAntiAffinityWithRequiredReq applies a HARD requirement to pod.spec.affinity.PodAntiAffinity.
	PodAntiAffinityWithRequiredReq
	// PodAntiAffinityWithPreferredReq applies a SOFT requirement to pod.spec.affinity.PodAntiAffinity.
	PodAntiAffinityWithPreferredReq
	// PodAntiAffinityWithRequiredPreferredReq applies HARD and SOFT requirements to pod.spec.affinity.PodAntiAffinity.
	PodAntiAffinityWithRequiredPreferredReq
)

type PodSchedulingWrapper added in v1.26.0

type PodSchedulingWrapper struct {
	resourceapi.PodSchedulingContext
}

PodSchedulingWrapper wraps a PodSchedulingContext inside.

func FromPodSchedulingContexts added in v1.27.0

func FromPodSchedulingContexts(other *resourceapi.PodSchedulingContext) *PodSchedulingWrapper

FromPodSchedulingContexts creates a PodSchedulingContext wrapper from an existing object.

func MakePodSchedulingContexts added in v1.27.0

func MakePodSchedulingContexts() *PodSchedulingWrapper

MakePodSchedulingContexts creates a PodSchedulingContext wrapper.

func (*PodSchedulingWrapper) Label added in v1.26.0

func (wrapper *PodSchedulingWrapper) Label(k, v string) *PodSchedulingWrapper

Label applies a {k,v} label pair to the inner object

func (*PodSchedulingWrapper) Name added in v1.26.0

Name sets `s` as the name of the inner object.

func (*PodSchedulingWrapper) Namespace added in v1.26.0

func (wrapper *PodSchedulingWrapper) Namespace(s string) *PodSchedulingWrapper

Namespace sets `s` as the namespace of the inner object.

func (*PodSchedulingWrapper) Obj added in v1.26.0

Obj returns the inner object.

func (*PodSchedulingWrapper) OwnerReference added in v1.26.0

func (wrapper *PodSchedulingWrapper) OwnerReference(name, uid string, gvk schema.GroupVersionKind) *PodSchedulingWrapper

OwnerReference updates the owning controller of the inner object.

func (*PodSchedulingWrapper) PotentialNodes added in v1.26.0

func (wrapper *PodSchedulingWrapper) PotentialNodes(nodes ...string) *PodSchedulingWrapper

PotentialNodes sets that field of the inner object.

func (*PodSchedulingWrapper) ResourceClaims added in v1.26.0

ResourceClaims sets that field of the inner object.

func (*PodSchedulingWrapper) SelectedNode added in v1.26.0

func (wrapper *PodSchedulingWrapper) SelectedNode(s string) *PodSchedulingWrapper

SelectedNode sets that field of the inner object.

func (*PodSchedulingWrapper) UID added in v1.26.0

UID sets `s` as the UID of the inner object.

type PodWrapper added in v1.16.0

type PodWrapper struct{ v1.Pod }

PodWrapper wraps a Pod inside.

func MakePod added in v1.16.0

func MakePod() *PodWrapper

MakePod creates a Pod wrapper.

func (*PodWrapper) Annotation added in v1.25.0

func (p *PodWrapper) Annotation(key, value string) *PodWrapper

Annotation sets a {k,v} pair to the inner pod annotation.

func (*PodWrapper) Annotations added in v1.25.0

func (p *PodWrapper) Annotations(annotations map[string]string) *PodWrapper

Annotations sets all {k,v} pair provided by `annotations` to the inner pod annotations.

func (*PodWrapper) Condition added in v1.25.0

Condition adds a `condition(Type, Status, Reason)` to .Status.Conditions.

func (*PodWrapper) Conditions added in v1.25.0

func (p *PodWrapper) Conditions(conditions []v1.PodCondition) *PodWrapper

Conditions sets `conditions` as .status.Conditions of the inner pod.

func (*PodWrapper) Container added in v1.16.0

func (p *PodWrapper) Container(s string) *PodWrapper

Container appends a container into PodSpec of the inner pod.

func (*PodWrapper) ContainerPort added in v1.25.0

func (p *PodWrapper) ContainerPort(ports []v1.ContainerPort) *PodWrapper

ContainerPort creates a container with ports valued `ports`, and injects into the inner pod.

func (*PodWrapper) Containers added in v1.25.0

func (p *PodWrapper) Containers(containers []v1.Container) *PodWrapper

Containers sets `containers` to the PodSpec of the inner pod.

func (*PodWrapper) CreationTimestamp added in v1.25.0

func (p *PodWrapper) CreationTimestamp(t metav1.Time) *PodWrapper

CreationTimestamp sets the inner pod's CreationTimestamp.

func (*PodWrapper) HostPort added in v1.22.0

func (p *PodWrapper) HostPort(port int32) *PodWrapper

HostPort creates a container with a hostPort valued `hostPort`, and injects into the inner pod.

func (*PodWrapper) InitReq added in v1.25.0

func (p *PodWrapper) InitReq(resMap map[v1.ResourceName]string) *PodWrapper

InitReq adds a new init container to the inner pod with given resource map.

func (*PodWrapper) Label added in v1.16.0

func (p *PodWrapper) Label(k, v string) *PodWrapper

Label sets a {k,v} pair to the inner pod label.

func (*PodWrapper) Labels added in v1.25.0

func (p *PodWrapper) Labels(labels map[string]string) *PodWrapper

Labels sets all {k,v} pair provided by `labels` to the inner pod labels.

func (*PodWrapper) Lim added in v1.27.0

func (p *PodWrapper) Lim(limMap map[v1.ResourceName]string) *PodWrapper

Lim adds a new container to the inner pod with given resource map of limits.

func (*PodWrapper) Name added in v1.16.0

func (p *PodWrapper) Name(s string) *PodWrapper

Name sets `s` as the name of the inner pod.

func (*PodWrapper) Namespace added in v1.16.0

func (p *PodWrapper) Namespace(s string) *PodWrapper

Namespace sets `s` as the namespace of the inner pod.

func (*PodWrapper) Node added in v1.16.0

func (p *PodWrapper) Node(s string) *PodWrapper

Node sets `s` as the nodeName of the inner pod.

func (*PodWrapper) NodeAffinityIn added in v1.16.0

func (p *PodWrapper) NodeAffinityIn(key string, vals []string) *PodWrapper

NodeAffinityIn creates a HARD node affinity (with the operator In) and injects into the inner pod.

func (*PodWrapper) NodeAffinityNotIn added in v1.16.0

func (p *PodWrapper) NodeAffinityNotIn(key string, vals []string) *PodWrapper

NodeAffinityNotIn creates a HARD node affinity (with the operator NotIn) and injects into the inner pod.

func (*PodWrapper) NodeSelector added in v1.16.0

func (p *PodWrapper) NodeSelector(m map[string]string) *PodWrapper

NodeSelector sets `m` as the nodeSelector of the inner pod.

func (*PodWrapper) NominatedNodeName added in v1.19.0

func (p *PodWrapper) NominatedNodeName(n string) *PodWrapper

NominatedNodeName sets `n` as the .Status.NominatedNodeName of the inner pod.

func (*PodWrapper) Obj added in v1.16.0

func (p *PodWrapper) Obj() *v1.Pod

Obj returns the inner Pod.

func (*PodWrapper) Overhead added in v1.24.0

func (p *PodWrapper) Overhead(rl v1.ResourceList) *PodWrapper

Overhead sets the give ResourceList to the inner pod

func (*PodWrapper) OwnerReference added in v1.22.0

func (p *PodWrapper) OwnerReference(name string, gvk schema.GroupVersionKind) *PodWrapper

OwnerReference updates the owning controller of the pod.

func (*PodWrapper) PVC added in v1.23.0

func (p *PodWrapper) PVC(name string) *PodWrapper

PVC creates a Volume with a PVC and injects into the inner pod.

func (*PodWrapper) Phase added in v1.25.0

func (p *PodWrapper) Phase(phase v1.PodPhase) *PodWrapper

Phase sets `phase` as .status.Phase of the inner pod.

func (*PodWrapper) PodAffinity added in v1.25.0

func (p *PodWrapper) PodAffinity(topologyKey string, labelSelector *metav1.LabelSelector, kind PodAffinityKind) *PodWrapper

PodAffinity creates a PodAffinity with topology key and label selector and injects into the inner pod.

func (*PodWrapper) PodAffinityExists added in v1.17.0

func (p *PodWrapper) PodAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper

PodAffinityExists creates a PodAffinity with the operator "Exists" and injects into the inner pod.

func (*PodWrapper) PodAffinityIn added in v1.25.0

func (p *PodWrapper) PodAffinityIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper

PodAffinityIn creates a PodAffinity with the operator "In" and injects into the inner pod.

func (*PodWrapper) PodAffinityNotExists added in v1.25.0

func (p *PodWrapper) PodAffinityNotExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper

PodAffinityNotExists creates a PodAffinity with the operator "NotExists" and injects into the inner pod.

func (*PodWrapper) PodAffinityNotIn added in v1.25.0

func (p *PodWrapper) PodAffinityNotIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper

PodAffinityNotIn creates a PodAffinity with the operator "NotIn" and injects into the inner pod.

func (*PodWrapper) PodAntiAffinity added in v1.25.0

func (p *PodWrapper) PodAntiAffinity(topologyKey string, labelSelector *metav1.LabelSelector, kind PodAffinityKind) *PodWrapper

PodAntiAffinity creates a PodAntiAffinity with topology key and label selector and injects into the inner pod.

func (*PodWrapper) PodAntiAffinityExists added in v1.17.0

func (p *PodWrapper) PodAntiAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper

PodAntiAffinityExists creates a PodAntiAffinity with the operator "Exists" and injects into the inner pod.

func (*PodWrapper) PodAntiAffinityIn added in v1.25.0

func (p *PodWrapper) PodAntiAffinityIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper

PodAntiAffinityIn creates a PodAntiAffinity with the operator "In" and injects into the inner pod.

func (*PodWrapper) PodAntiAffinityNotExists added in v1.25.0

func (p *PodWrapper) PodAntiAffinityNotExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper

PodAntiAffinityNotExists creates a PodAntiAffinity with the operator "NotExists" and injects into the inner pod.

func (*PodWrapper) PodAntiAffinityNotIn added in v1.25.0

func (p *PodWrapper) PodAntiAffinityNotIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper

PodAntiAffinityNotIn creates a PodAntiAffinity with the operator "NotIn" and injects into the inner pod.

func (*PodWrapper) PodResourceClaims added in v1.26.0

func (p *PodWrapper) PodResourceClaims(podResourceClaims ...v1.PodResourceClaim) *PodWrapper

PodResourceClaims appends PodResourceClaims into PodSpec of the inner pod.

func (*PodWrapper) PreemptionPolicy added in v1.19.0

func (p *PodWrapper) PreemptionPolicy(policy v1.PreemptionPolicy) *PodWrapper

PreemptionPolicy sets the give preemption policy to the inner pod.

func (*PodWrapper) Priority added in v1.16.0

func (p *PodWrapper) Priority(val int32) *PodWrapper

Priority sets a priority value into PodSpec of the inner pod.

func (*PodWrapper) Req added in v1.19.0

func (p *PodWrapper) Req(reqMap map[v1.ResourceName]string) *PodWrapper

Req adds a new container to the inner pod with given resource map of requests.

func (*PodWrapper) Res added in v1.27.0

func (p *PodWrapper) Res(resMap map[v1.ResourceName]string) *PodWrapper

Res adds a new container to the inner pod with given resource map.

func (*PodWrapper) SchedulerName added in v1.18.0

func (p *PodWrapper) SchedulerName(s string) *PodWrapper

SchedulerName sets `s` as the scheduler name of the inner pod.

func (*PodWrapper) SchedulingGates added in v1.26.0

func (p *PodWrapper) SchedulingGates(gates []string) *PodWrapper

SchedulingGates sets `gates` as additional SchedulerGates of the inner pod.

func (*PodWrapper) SpreadConstraint added in v1.16.0

func (p *PodWrapper) SpreadConstraint(maxSkew int, tpKey string, mode v1.UnsatisfiableConstraintAction, selector *metav1.LabelSelector, minDomains *int32, nodeAffinityPolicy, nodeTaintsPolicy *v1.NodeInclusionPolicy, matchLabelKeys []string) *PodWrapper

SpreadConstraint constructs a TopologySpreadConstraint object and injects into the inner pod.

func (*PodWrapper) StartTime added in v1.19.0

func (p *PodWrapper) StartTime(t metav1.Time) *PodWrapper

StartTime sets `t` as .status.startTime for the inner pod.

func (*PodWrapper) Terminating added in v1.18.0

func (p *PodWrapper) Terminating() *PodWrapper

Terminating sets the inner pod's deletionTimestamp to current timestamp.

func (*PodWrapper) Toleration added in v1.21.13

func (p *PodWrapper) Toleration(key string) *PodWrapper

Toleration creates a toleration (with the operator Exists) and injects into the inner pod.

func (*PodWrapper) UID added in v1.18.0

func (p *PodWrapper) UID(s string) *PodWrapper

UID sets `s` as the UID of the inner pod.

func (*PodWrapper) Volume added in v1.25.0

func (p *PodWrapper) Volume(volume v1.Volume) *PodWrapper

Volume creates volume and injects into the inner pod.

func (*PodWrapper) Volumes added in v1.29.0

func (p *PodWrapper) Volumes(volumes []v1.Volume) *PodWrapper

Volumes set the volumes and inject into the inner pod.

func (*PodWrapper) ZeroTerminationGracePeriod added in v1.16.0

func (p *PodWrapper) ZeroTerminationGracePeriod() *PodWrapper

ZeroTerminationGracePeriod sets the TerminationGracePeriodSeconds of the inner pod to zero.

type ResourceClaimWrapper added in v1.26.0

type ResourceClaimWrapper struct{ resourceapi.ResourceClaim }

ResourceClaimWrapper wraps a ResourceClaim inside.

func FromResourceClaim added in v1.26.0

func FromResourceClaim(other *resourceapi.ResourceClaim) *ResourceClaimWrapper

FromResourceClaim creates a ResourceClaim wrapper from some existing object.

func MakeResourceClaim added in v1.26.0

func MakeResourceClaim(controller string) *ResourceClaimWrapper

MakeResourceClaim creates a ResourceClaim wrapper.

func (*ResourceClaimWrapper) Allocation added in v1.26.0

func (wrapper *ResourceClaimWrapper) Allocation(allocation *resourceapi.AllocationResult) *ResourceClaimWrapper

Allocation sets the allocation of the inner object.

func (*ResourceClaimWrapper) DeallocationRequested added in v1.26.0

func (wrapper *ResourceClaimWrapper) DeallocationRequested(deallocationRequested bool) *ResourceClaimWrapper

DeallocationRequested sets that field of the inner object.

func (*ResourceClaimWrapper) Name added in v1.26.0

Name sets `s` as the name of the inner object.

func (*ResourceClaimWrapper) Namespace added in v1.26.0

func (wrapper *ResourceClaimWrapper) Namespace(s string) *ResourceClaimWrapper

Namespace sets `s` as the namespace of the inner object.

func (*ResourceClaimWrapper) Obj added in v1.26.0

Obj returns the inner ResourceClaim.

func (*ResourceClaimWrapper) OwnerReference added in v1.26.0

func (wrapper *ResourceClaimWrapper) OwnerReference(name, uid string, gvk schema.GroupVersionKind) *ResourceClaimWrapper

OwnerReference updates the owning controller of the object.

func (*ResourceClaimWrapper) Request added in v1.31.0

func (wrapper *ResourceClaimWrapper) Request(deviceClassName string) *ResourceClaimWrapper

Request adds one device request for the given device class.

func (*ResourceClaimWrapper) ReservedFor added in v1.26.0

ReservedFor sets that field of the inner object.

func (*ResourceClaimWrapper) ReservedForPod added in v1.31.0

func (wrapper *ResourceClaimWrapper) ReservedForPod(podName string, podUID types.UID) *ResourceClaimWrapper

ReservedFor sets that field of the inner object given information about one pod.

func (*ResourceClaimWrapper) Structured added in v1.31.0

func (wrapper *ResourceClaimWrapper) Structured() *ResourceClaimWrapper

Structured turns a "normal" claim into one which was allocated via structured parameters. The only difference is that there is no controller name and the special finalizer gets added.

func (*ResourceClaimWrapper) UID added in v1.26.0

UID sets `s` as the UID of the inner object.

type ResourceSliceWrapper added in v1.31.0

type ResourceSliceWrapper struct {
	resourceapi.ResourceSlice
}

func MakeResourceSlice added in v1.31.0

func MakeResourceSlice(nodeName, driverName string) *ResourceSliceWrapper

func (*ResourceSliceWrapper) Device added in v1.31.0

func (*ResourceSliceWrapper) Devices added in v1.31.0

func (wrapper *ResourceSliceWrapper) Devices(names ...string) *ResourceSliceWrapper

func (*ResourceSliceWrapper) Obj added in v1.31.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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