package testing
import "k8s.io/kubernetes/pkg/scheduler/testing"
Index ¶
- func MakeNodesAndPodsForEvenPodsSpread(labels map[string]string, existingPodsNum, allNodesNum, filteredNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node, filteredNodes []*v1.Node)
- type CSIDriverWrapper
- func MakeCSIDriver() *CSIDriverWrapper
- func (c *CSIDriverWrapper) Name(n string) *CSIDriverWrapper
- func (c *CSIDriverWrapper) Obj() *storagev1.CSIDriver
- func (c *CSIDriverWrapper) StorageCapacity(storageCapacity *bool) *CSIDriverWrapper
- type CSINodeWrapper
- func MakeCSINode() *CSINodeWrapper
- func (c *CSINodeWrapper) Annotation(key, value string) *CSINodeWrapper
- func (c *CSINodeWrapper) Driver(driver storagev1.CSINodeDriver) *CSINodeWrapper
- func (c *CSINodeWrapper) Name(n string) *CSINodeWrapper
- func (c *CSINodeWrapper) Obj() *storagev1.CSINode
- type CSIStorageCapacityWrapper
- func MakeCSIStorageCapacity() *CSIStorageCapacityWrapper
- func (c *CSIStorageCapacityWrapper) Capacity(capacity *resource.Quantity) *CSIStorageCapacityWrapper
- func (c *CSIStorageCapacityWrapper) Name(n string) *CSIStorageCapacityWrapper
- func (c *CSIStorageCapacityWrapper) Obj() *storagev1.CSIStorageCapacity
- func (c *CSIStorageCapacityWrapper) StorageClassName(name string) *CSIStorageCapacityWrapper
- type ContainerWrapper
- func MakeContainer() *ContainerWrapper
- func (c *ContainerWrapper) ContainerPort(ports []v1.ContainerPort) *ContainerWrapper
- func (c *ContainerWrapper) HostPort(hostPort int32) *ContainerWrapper
- func (c *ContainerWrapper) Image(image string) *ContainerWrapper
- func (c *ContainerWrapper) Name(n string) *ContainerWrapper
- func (c *ContainerWrapper) Obj() v1.Container
- func (c *ContainerWrapper) ResourceLimits(limMap map[v1.ResourceName]string) *ContainerWrapper
- func (c *ContainerWrapper) ResourceRequests(reqMap map[v1.ResourceName]string) *ContainerWrapper
- func (c *ContainerWrapper) Resources(resMap map[v1.ResourceName]string) *ContainerWrapper
- func (c *ContainerWrapper) RestartPolicy(restartPolicy v1.ContainerRestartPolicy) *ContainerWrapper
- type LabelSelectorWrapper
- func MakeLabelSelector() *LabelSelectorWrapper
- func (s *LabelSelectorWrapper) Exists(k string) *LabelSelectorWrapper
- func (s *LabelSelectorWrapper) In(key string, vals []string) *LabelSelectorWrapper
- func (s *LabelSelectorWrapper) Label(k, v string) *LabelSelectorWrapper
- func (s *LabelSelectorWrapper) NotExist(k string) *LabelSelectorWrapper
- func (s *LabelSelectorWrapper) NotIn(key string, vals []string) *LabelSelectorWrapper
- func (s *LabelSelectorWrapper) Obj() *metav1.LabelSelector
- type NodeSelectorType
- type NodeSelectorWrapper
- func MakeNodeSelector() *NodeSelectorWrapper
- func (s *NodeSelectorWrapper) In(key string, vals []string, t NodeSelectorType) *NodeSelectorWrapper
- func (s *NodeSelectorWrapper) NotIn(key string, vals []string) *NodeSelectorWrapper
- func (s *NodeSelectorWrapper) Obj() *v1.NodeSelector
- type NodeWrapper
- func MakeNode() *NodeWrapper
- func (n *NodeWrapper) Annotation(k, v string) *NodeWrapper
- func (n *NodeWrapper) Capacity(resources map[v1.ResourceName]string) *NodeWrapper
- func (n *NodeWrapper) Condition(typ v1.NodeConditionType, status v1.ConditionStatus, message, reason string) *NodeWrapper
- func (n *NodeWrapper) Images(images map[string]int64) *NodeWrapper
- func (n *NodeWrapper) Label(k, v string) *NodeWrapper
- func (n *NodeWrapper) Name(s string) *NodeWrapper
- func (n *NodeWrapper) Obj() *v1.Node
- func (n *NodeWrapper) Taints(taints []v1.Taint) *NodeWrapper
- func (n *NodeWrapper) UID(s string) *NodeWrapper
- func (n *NodeWrapper) Unschedulable(unschedulable bool) *NodeWrapper
- type PersistentVolumeClaimWrapper
- func MakePersistentVolumeClaim() *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) AccessModes(accessModes []v1.PersistentVolumeAccessMode) *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) Annotation(key, value string) *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) Name(s string) *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) Namespace(s string) *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) Obj() *v1.PersistentVolumeClaim
- func (p *PersistentVolumeClaimWrapper) Resources(resources v1.VolumeResourceRequirements) *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) StorageClassName(name *string) *PersistentVolumeClaimWrapper
- func (p *PersistentVolumeClaimWrapper) VolumeName(name string) *PersistentVolumeClaimWrapper
- type PersistentVolumeWrapper
- func MakePersistentVolume() *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) AccessModes(accessModes []v1.PersistentVolumeAccessMode) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) Capacity(capacity v1.ResourceList) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) HostPathVolumeSource(src *v1.HostPathVolumeSource) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) Label(k, v string) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) Labels(labels map[string]string) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) Name(s string) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) NodeAffinityIn(key string, vals []string) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) Obj() *v1.PersistentVolume
- func (p *PersistentVolumeWrapper) PersistentVolumeSource(src v1.PersistentVolumeSource) *PersistentVolumeWrapper
- func (p *PersistentVolumeWrapper) StorageClassName(name string) *PersistentVolumeWrapper
- type PodAffinityKind
- type PodDisruptionBudgetWrapper
- func MakePDB() *PodDisruptionBudgetWrapper
- func (p *PodDisruptionBudgetWrapper) DisruptionsAllowed(disruptionsAllowed int32) *PodDisruptionBudgetWrapper
- func (p *PodDisruptionBudgetWrapper) MatchLabel(key, value string) *PodDisruptionBudgetWrapper
- func (p *PodDisruptionBudgetWrapper) MinAvailable(minAvailable string) *PodDisruptionBudgetWrapper
- func (p *PodDisruptionBudgetWrapper) Name(name string) *PodDisruptionBudgetWrapper
- func (p *PodDisruptionBudgetWrapper) Namespace(namespace string) *PodDisruptionBudgetWrapper
- func (p *PodDisruptionBudgetWrapper) Obj() *policy.PodDisruptionBudget
- type PodWrapper
- func MakePod() *PodWrapper
- func (p *PodWrapper) Annotation(key, value string) *PodWrapper
- func (p *PodWrapper) Annotations(annotations map[string]string) *PodWrapper
- func (p *PodWrapper) Condition(t v1.PodConditionType, s v1.ConditionStatus, r string) *PodWrapper
- func (p *PodWrapper) Conditions(conditions []v1.PodCondition) *PodWrapper
- func (p *PodWrapper) Container(s string) *PodWrapper
- func (p *PodWrapper) ContainerPort(ports []v1.ContainerPort) *PodWrapper
- func (p *PodWrapper) Containers(containers []v1.Container) *PodWrapper
- func (p *PodWrapper) CreationTimestamp(t metav1.Time) *PodWrapper
- func (p *PodWrapper) GenerateName(s string) *PodWrapper
- func (p *PodWrapper) HostPort(port int32) *PodWrapper
- func (p *PodWrapper) InitReq(resMap map[v1.ResourceName]string) *PodWrapper
- func (p *PodWrapper) Label(k, v string) *PodWrapper
- func (p *PodWrapper) Labels(labels map[string]string) *PodWrapper
- func (p *PodWrapper) Lim(limMap map[v1.ResourceName]string) *PodWrapper
- func (p *PodWrapper) Name(s string) *PodWrapper
- func (p *PodWrapper) Namespace(s string) *PodWrapper
- func (p *PodWrapper) Node(s string) *PodWrapper
- func (p *PodWrapper) NodeAffinityIn(key string, vals []string, t NodeSelectorType) *PodWrapper
- func (p *PodWrapper) NodeAffinityNotIn(key string, vals []string) *PodWrapper
- func (p *PodWrapper) NodeSelector(m map[string]string) *PodWrapper
- func (p *PodWrapper) NominatedNodeName(n string) *PodWrapper
- func (p *PodWrapper) Obj() *v1.Pod
- func (p *PodWrapper) Overhead(rl v1.ResourceList) *PodWrapper
- func (p *PodWrapper) OwnerReference(name string, gvk schema.GroupVersionKind) *PodWrapper
- func (p *PodWrapper) PVC(name string) *PodWrapper
- func (p *PodWrapper) Phase(phase v1.PodPhase) *PodWrapper
- func (p *PodWrapper) PodAffinity(topologyKey string, labelSelector *metav1.LabelSelector, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAffinityIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAffinityNotExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAffinityNotIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAntiAffinity(topologyKey string, labelSelector *metav1.LabelSelector, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAntiAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAntiAffinityIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAntiAffinityNotExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAntiAffinityNotIn(labelKey, topologyKey string, vals []string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodResourceClaims(podResourceClaims ...v1.PodResourceClaim) *PodWrapper
- func (p *PodWrapper) PreemptionPolicy(policy v1.PreemptionPolicy) *PodWrapper
- func (p *PodWrapper) Priority(val int32) *PodWrapper
- func (p *PodWrapper) Req(reqMap map[v1.ResourceName]string) *PodWrapper
- func (p *PodWrapper) Res(resMap map[v1.ResourceName]string) *PodWrapper
- func (p *PodWrapper) ResourceClaimStatuses(resourceClaimStatuses ...v1.PodResourceClaimStatus) *PodWrapper
- func (p *PodWrapper) Resources(resources v1.ResourceRequirements) *PodWrapper
- func (p *PodWrapper) SchedulerName(s string) *PodWrapper
- func (p *PodWrapper) SchedulingGates(gates []string) *PodWrapper
- func (p *PodWrapper) SidecarReq(resMap map[v1.ResourceName]string) *PodWrapper
- func (p *PodWrapper) SpreadConstraint(maxSkew int, tpKey string, mode v1.UnsatisfiableConstraintAction, selector *metav1.LabelSelector, minDomains *int32, nodeAffinityPolicy, nodeTaintsPolicy *v1.NodeInclusionPolicy, matchLabelKeys []string) *PodWrapper
- func (p *PodWrapper) StartTime(t metav1.Time) *PodWrapper
- func (p *PodWrapper) Terminating() *PodWrapper
- func (p *PodWrapper) Toleration(key string) *PodWrapper
- func (p *PodWrapper) Tolerations(tolerations []v1.Toleration) *PodWrapper
- func (p *PodWrapper) UID(s string) *PodWrapper
- func (p *PodWrapper) Volume(volume v1.Volume) *PodWrapper
- func (p *PodWrapper) Volumes(volumes []v1.Volume) *PodWrapper
- func (p *PodWrapper) ZeroTerminationGracePeriod() *PodWrapper
- type ResourceClaimWrapper
- func FromResourceClaim(other *resourceapi.ResourceClaim) *ResourceClaimWrapper
- func MakeResourceClaim() *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) Allocation(allocation *resourceapi.AllocationResult) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) Deleting(time metav1.Time) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) Name(s string) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) Namespace(s string) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) Obj() *resourceapi.ResourceClaim
- func (wrapper *ResourceClaimWrapper) OwnerReference(name, uid string, gvk schema.GroupVersionKind) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) Request(deviceClassName string) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) RequestWithPrioritizedList(deviceClassNames ...string) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) ReservedFor(consumers ...resourceapi.ResourceClaimConsumerReference) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) ReservedForPod(podName string, podUID types.UID) *ResourceClaimWrapper
- func (wrapper *ResourceClaimWrapper) UID(s string) *ResourceClaimWrapper
- type ResourceSliceWrapper
- func FromResourceSlice(other *resourceapi.ResourceSlice) *ResourceSliceWrapper
- func MakeResourceSlice(nodeName, driverName string) *ResourceSliceWrapper
- func (wrapper *ResourceSliceWrapper) Device(name string, otherFields ...any) *ResourceSliceWrapper
- func (wrapper *ResourceSliceWrapper) Devices(names ...string) *ResourceSliceWrapper
- func (wrapper *ResourceSliceWrapper) Obj() *resourceapi.ResourceSlice
- type StorageClassWrapper
- func MakeStorageClass() *StorageClassWrapper
- func (s *StorageClassWrapper) AllowedTopologies(topologies []v1.TopologySelectorTerm) *StorageClassWrapper
- func (s *StorageClassWrapper) Label(k, v string) *StorageClassWrapper
- func (s *StorageClassWrapper) Name(n string) *StorageClassWrapper
- func (s *StorageClassWrapper) Obj() *storagev1.StorageClass
- func (s *StorageClassWrapper) Provisioner(p string) *StorageClassWrapper
- func (s *StorageClassWrapper) VolumeBindingMode(mode storagev1.VolumeBindingMode) *StorageClassWrapper
- type VolumeAttachmentWrapper
- func MakeVolumeAttachment() *VolumeAttachmentWrapper
- func (c *VolumeAttachmentWrapper) Attached(attached bool) *VolumeAttachmentWrapper
- func (c *VolumeAttachmentWrapper) Attacher(attacher string) *VolumeAttachmentWrapper
- func (c *VolumeAttachmentWrapper) Name(n string) *VolumeAttachmentWrapper
- func (c *VolumeAttachmentWrapper) NodeName(nodeName string) *VolumeAttachmentWrapper
- func (c *VolumeAttachmentWrapper) Obj() *storagev1.VolumeAttachment
- func (c *VolumeAttachmentWrapper) Source(source storagev1.VolumeAttachmentSource) *VolumeAttachmentWrapper
Functions ¶
func MakeNodesAndPodsForEvenPodsSpread ¶
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 CSIDriverWrapper ¶
CSIDriverWrapper wraps a CSIDriver inside.
func MakeCSIDriver ¶
func MakeCSIDriver() *CSIDriverWrapper
MakeCSIDriver creates a CSIDriver wrapper.
func (*CSIDriverWrapper) Name ¶
func (c *CSIDriverWrapper) Name(n string) *CSIDriverWrapper
Name sets `n` as the name of the inner CSIDriver.
func (*CSIDriverWrapper) Obj ¶
func (c *CSIDriverWrapper) Obj() *storagev1.CSIDriver
Obj returns the inner CSIDriver.
func (*CSIDriverWrapper) StorageCapacity ¶
func (c *CSIDriverWrapper) StorageCapacity(storageCapacity *bool) *CSIDriverWrapper
StorageCapacity sets the `StorageCapacity` of the inner CSIDriver.
type CSINodeWrapper ¶
CSINodeWrapper wraps a CSINode inside.
func MakeCSINode ¶
func MakeCSINode() *CSINodeWrapper
MakeCSINode creates a CSINode wrapper.
func (*CSINodeWrapper) Annotation ¶
func (c *CSINodeWrapper) Annotation(key, value string) *CSINodeWrapper
Annotation sets a {k,v} pair to the inner CSINode annotation.
func (*CSINodeWrapper) Driver ¶
func (c *CSINodeWrapper) Driver(driver storagev1.CSINodeDriver) *CSINodeWrapper
Driver adds a driver to the inner CSINode.
func (*CSINodeWrapper) Name ¶
func (c *CSINodeWrapper) Name(n string) *CSINodeWrapper
Name sets `n` as the name of the inner CSINode.
func (*CSINodeWrapper) Obj ¶
func (c *CSINodeWrapper) Obj() *storagev1.CSINode
Obj returns the inner CSINode.
type CSIStorageCapacityWrapper ¶
type CSIStorageCapacityWrapper struct{ storagev1.CSIStorageCapacity }
CSIStorageCapacityWrapper wraps a CSIStorageCapacity inside.
func MakeCSIStorageCapacity ¶
func MakeCSIStorageCapacity() *CSIStorageCapacityWrapper
MakeCSIStorageCapacity creates a CSIStorageCapacity wrapper.
func (*CSIStorageCapacityWrapper) Capacity ¶
func (c *CSIStorageCapacityWrapper) Capacity(capacity *resource.Quantity) *CSIStorageCapacityWrapper
Capacity sets the `Capacity` of the inner CSIStorageCapacity.
func (*CSIStorageCapacityWrapper) Name ¶
func (c *CSIStorageCapacityWrapper) Name(n string) *CSIStorageCapacityWrapper
Name sets `n` as the name of the inner CSIStorageCapacity.
func (*CSIStorageCapacityWrapper) Obj ¶
func (c *CSIStorageCapacityWrapper) Obj() *storagev1.CSIStorageCapacity
Obj returns the inner CSIStorageCapacity.
func (*CSIStorageCapacityWrapper) StorageClassName ¶
func (c *CSIStorageCapacityWrapper) StorageClassName(name string) *CSIStorageCapacityWrapper
StorageClassName sets the `StorageClassName` of the inner CSIStorageCapacity.
type ContainerWrapper ¶
ContainerWrapper wraps a Container inside.
func MakeContainer ¶
func MakeContainer() *ContainerWrapper
MakeContainer creates a Container wrapper.
func (*ContainerWrapper) ContainerPort ¶
func (c *ContainerWrapper) ContainerPort(ports []v1.ContainerPort) *ContainerWrapper
ContainerPort sets `ports` as the ports of the inner Container.
func (*ContainerWrapper) HostPort ¶
func (c *ContainerWrapper) HostPort(hostPort int32) *ContainerWrapper
HostPort sets `hostPort` as the host port of the inner Container.
func (*ContainerWrapper) Image ¶
func (c *ContainerWrapper) Image(image string) *ContainerWrapper
Image sets `image` as the image of the inner Container.
func (*ContainerWrapper) Name ¶
func (c *ContainerWrapper) Name(n string) *ContainerWrapper
Name sets `n` as the name of the inner Container.
func (*ContainerWrapper) Obj ¶
func (c *ContainerWrapper) Obj() v1.Container
Obj returns the inner Container.
func (*ContainerWrapper) ResourceLimits ¶
func (c *ContainerWrapper) ResourceLimits(limMap map[v1.ResourceName]string) *ContainerWrapper
ResourceLimits sets the container resource limits to the given resource map.
func (*ContainerWrapper) ResourceRequests ¶
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 ¶
func (c *ContainerWrapper) Resources(resMap map[v1.ResourceName]string) *ContainerWrapper
Resources sets the container resources to the given resource map.
func (*ContainerWrapper) RestartPolicy ¶
func (c *ContainerWrapper) RestartPolicy(restartPolicy v1.ContainerRestartPolicy) *ContainerWrapper
RestartPolicy sets the container's restartPolicy to the given restartPolicy.
type LabelSelectorWrapper ¶
type LabelSelectorWrapper struct{ metav1.LabelSelector }
LabelSelectorWrapper wraps a LabelSelector inside.
func MakeLabelSelector ¶
func MakeLabelSelector() *LabelSelectorWrapper
MakeLabelSelector creates a LabelSelector wrapper.
func (*LabelSelectorWrapper) Exists ¶
func (s *LabelSelectorWrapper) Exists(k string) *LabelSelectorWrapper
Exists injects a matchExpression (with an operator Exists) to the inner labelSelector.
func (*LabelSelectorWrapper) In ¶
func (s *LabelSelectorWrapper) In(key string, vals []string) *LabelSelectorWrapper
In injects a matchExpression (with an operator In) to the inner labelSelector.
func (*LabelSelectorWrapper) Label ¶
func (s *LabelSelectorWrapper) Label(k, v string) *LabelSelectorWrapper
Label applies a {k,v} pair to the inner LabelSelector.
func (*LabelSelectorWrapper) NotExist ¶
func (s *LabelSelectorWrapper) NotExist(k string) *LabelSelectorWrapper
NotExist injects a matchExpression (with an operator NotExist) to the inner labelSelector.
func (*LabelSelectorWrapper) NotIn ¶
func (s *LabelSelectorWrapper) NotIn(key string, vals []string) *LabelSelectorWrapper
NotIn injects a matchExpression (with an operator NotIn) to the inner labelSelector.
func (*LabelSelectorWrapper) Obj ¶
func (s *LabelSelectorWrapper) Obj() *metav1.LabelSelector
Obj returns the inner LabelSelector.
type NodeSelectorType ¶
type NodeSelectorType int
const ( NodeSelectorTypeMatchExpressions NodeSelectorType = iota NodeSelectorTypeMatchFields )
type NodeSelectorWrapper ¶
type NodeSelectorWrapper struct{ v1.NodeSelector }
NodeSelectorWrapper wraps a NodeSelector inside.
func MakeNodeSelector ¶
func MakeNodeSelector() *NodeSelectorWrapper
MakeNodeSelector creates a NodeSelector wrapper.
func (*NodeSelectorWrapper) In ¶
func (s *NodeSelectorWrapper) In(key string, vals []string, t NodeSelectorType) *NodeSelectorWrapper
In injects a matchExpression (with an operator IN) as a selectorTerm to the inner nodeSelector. NOTE: appended selectorTerms are ORed.
func (*NodeSelectorWrapper) NotIn ¶
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 ¶
func (s *NodeSelectorWrapper) Obj() *v1.NodeSelector
Obj returns the inner NodeSelector.
type NodeWrapper ¶
NodeWrapper wraps a Node inside.
func MakeNode ¶
func MakeNode() *NodeWrapper
MakeNode creates a Node wrapper.
func (*NodeWrapper) Annotation ¶
func (n *NodeWrapper) Annotation(k, v string) *NodeWrapper
Annotation applies a {k,v} annotation pair to the inner node.
func (*NodeWrapper) Capacity ¶
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 ¶
func (n *NodeWrapper) Condition(typ v1.NodeConditionType, status v1.ConditionStatus, message, reason string) *NodeWrapper
Condition applies the node condition.
func (*NodeWrapper) Images ¶
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 ¶
func (n *NodeWrapper) Label(k, v string) *NodeWrapper
Label applies a {k,v} label pair to the inner node.
func (*NodeWrapper) Name ¶
func (n *NodeWrapper) Name(s string) *NodeWrapper
Name sets `s` as the name of the inner pod.
func (*NodeWrapper) Obj ¶
func (n *NodeWrapper) Obj() *v1.Node
Obj returns the inner Node.
func (*NodeWrapper) Taints ¶
func (n *NodeWrapper) Taints(taints []v1.Taint) *NodeWrapper
Taints applies taints to the inner node.
func (*NodeWrapper) UID ¶
func (n *NodeWrapper) UID(s string) *NodeWrapper
UID sets `s` as the UID of the inner pod.
func (*NodeWrapper) Unschedulable ¶
func (n *NodeWrapper) Unschedulable(unschedulable bool) *NodeWrapper
Unschedulable applies the unschedulable field.
type PersistentVolumeClaimWrapper ¶
type PersistentVolumeClaimWrapper struct{ v1.PersistentVolumeClaim }
PersistentVolumeClaimWrapper wraps a PersistentVolumeClaim inside.
func MakePersistentVolumeClaim ¶
func MakePersistentVolumeClaim() *PersistentVolumeClaimWrapper
MakePersistentVolumeClaim creates a PersistentVolumeClaim wrapper.
func (*PersistentVolumeClaimWrapper) AccessModes ¶
func (p *PersistentVolumeClaimWrapper) AccessModes(accessModes []v1.PersistentVolumeAccessMode) *PersistentVolumeClaimWrapper
AccessModes sets `accessModes` as the access modes of the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) Annotation ¶
func (p *PersistentVolumeClaimWrapper) Annotation(key, value string) *PersistentVolumeClaimWrapper
Annotation sets a {k,v} pair to the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) Name ¶
func (p *PersistentVolumeClaimWrapper) Name(s string) *PersistentVolumeClaimWrapper
Name sets `s` as the name of the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) Namespace ¶
func (p *PersistentVolumeClaimWrapper) Namespace(s string) *PersistentVolumeClaimWrapper
Namespace sets `s` as the namespace of the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) Obj ¶
func (p *PersistentVolumeClaimWrapper) Obj() *v1.PersistentVolumeClaim
Obj returns the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) Resources ¶
func (p *PersistentVolumeClaimWrapper) Resources(resources v1.VolumeResourceRequirements) *PersistentVolumeClaimWrapper
Resources sets `resources` as the resource requirements of the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) StorageClassName ¶
func (p *PersistentVolumeClaimWrapper) StorageClassName(name *string) *PersistentVolumeClaimWrapper
StorageClassName sets `StorageClassName` as the StorageClassName of the inner PersistentVolumeClaim.
func (*PersistentVolumeClaimWrapper) VolumeName ¶
func (p *PersistentVolumeClaimWrapper) VolumeName(name string) *PersistentVolumeClaimWrapper
VolumeName sets `name` as the volume name of the inner PersistentVolumeClaim.
type PersistentVolumeWrapper ¶
type PersistentVolumeWrapper struct{ v1.PersistentVolume }
PersistentVolumeWrapper wraps a PersistentVolume inside.
func MakePersistentVolume ¶
func MakePersistentVolume() *PersistentVolumeWrapper
MakePersistentVolume creates a PersistentVolume wrapper.
func (*PersistentVolumeWrapper) AccessModes ¶
func (p *PersistentVolumeWrapper) AccessModes(accessModes []v1.PersistentVolumeAccessMode) *PersistentVolumeWrapper
AccessModes sets `accessModes` as the access modes of the inner PersistentVolume.
func (*PersistentVolumeWrapper) Capacity ¶
func (p *PersistentVolumeWrapper) Capacity(capacity v1.ResourceList) *PersistentVolumeWrapper
Capacity sets `capacity` as the resource list of the inner PersistentVolume.
func (*PersistentVolumeWrapper) HostPathVolumeSource ¶
func (p *PersistentVolumeWrapper) HostPathVolumeSource(src *v1.HostPathVolumeSource) *PersistentVolumeWrapper
HostPathVolumeSource sets `src` as the host path volume source of the inner PersistentVolume.
func (*PersistentVolumeWrapper) Label ¶
func (p *PersistentVolumeWrapper) Label(k, v string) *PersistentVolumeWrapper
Label sets a {k,v} pair to the pv.
func (*PersistentVolumeWrapper) Labels ¶
func (p *PersistentVolumeWrapper) Labels(labels map[string]string) *PersistentVolumeWrapper
Labels sets all {k,v} pair provided by `labels` to the pv.
func (*PersistentVolumeWrapper) Name ¶
func (p *PersistentVolumeWrapper) Name(s string) *PersistentVolumeWrapper
Name sets `s` as the name of the inner PersistentVolume.
func (*PersistentVolumeWrapper) NodeAffinityIn ¶
func (p *PersistentVolumeWrapper) NodeAffinityIn(key string, vals []string) *PersistentVolumeWrapper
NodeAffinityIn creates a HARD node affinity (with MatchExpressions and the operator In) and injects into the pv.
func (*PersistentVolumeWrapper) Obj ¶
func (p *PersistentVolumeWrapper) Obj() *v1.PersistentVolume
Obj returns the inner PersistentVolume.
func (*PersistentVolumeWrapper) PersistentVolumeSource ¶
func (p *PersistentVolumeWrapper) PersistentVolumeSource(src v1.PersistentVolumeSource) *PersistentVolumeWrapper
PersistentVolumeSource sets `src` as the pv source of the inner
func (*PersistentVolumeWrapper) StorageClassName ¶
func (p *PersistentVolumeWrapper) StorageClassName(name string) *PersistentVolumeWrapper
StorageClassName sets `StorageClassName` of the inner PersistentVolume.
type PodAffinityKind ¶
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 PodDisruptionBudgetWrapper ¶
type PodDisruptionBudgetWrapper struct { policy.PodDisruptionBudget }
PodDisruptionBudgetWrapper wraps a PodDisruptionBudget inside.
func MakePDB ¶
func MakePDB() *PodDisruptionBudgetWrapper
MakePDB creates a PodDisruptionBudget wrapper.
func (*PodDisruptionBudgetWrapper) DisruptionsAllowed ¶
func (p *PodDisruptionBudgetWrapper) DisruptionsAllowed(disruptionsAllowed int32) *PodDisruptionBudgetWrapper
DisruptionsAllowed sets `disruptionsAllowed` to the inner PodDisruptionBudget.Status.DisruptionsAllowed.
func (*PodDisruptionBudgetWrapper) MatchLabel ¶
func (p *PodDisruptionBudgetWrapper) MatchLabel(key, value string) *PodDisruptionBudgetWrapper
MatchLabel adds a {key,value} to the inner PodDisruptionBudget.Spec.Selector.MatchLabels.
func (*PodDisruptionBudgetWrapper) MinAvailable ¶
func (p *PodDisruptionBudgetWrapper) MinAvailable(minAvailable string) *PodDisruptionBudgetWrapper
MinAvailable sets `minAvailable` to the inner PodDisruptionBudget.Spec.MinAvailable.
func (*PodDisruptionBudgetWrapper) Name ¶
func (p *PodDisruptionBudgetWrapper) Name(name string) *PodDisruptionBudgetWrapper
Name sets `name` as the name of the inner PodDisruptionBudget.
func (*PodDisruptionBudgetWrapper) Namespace ¶
func (p *PodDisruptionBudgetWrapper) Namespace(namespace string) *PodDisruptionBudgetWrapper
Namespace sets `namespace` as the namespace of the inner PodDisruptionBudget.
func (*PodDisruptionBudgetWrapper) Obj ¶
func (p *PodDisruptionBudgetWrapper) Obj() *policy.PodDisruptionBudget
Obj returns the inner PodDisruptionBudget.
type PodWrapper ¶
PodWrapper wraps a Pod inside.
func MakePod ¶
func MakePod() *PodWrapper
MakePod creates a Pod wrapper.
func (*PodWrapper) Annotation ¶
func (p *PodWrapper) Annotation(key, value string) *PodWrapper
Annotation sets a {k,v} pair to the inner pod annotation.
func (*PodWrapper) Annotations ¶
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 ¶
func (p *PodWrapper) Condition(t v1.PodConditionType, s v1.ConditionStatus, r string) *PodWrapper
Condition adds a `condition(Type, Status, Reason)` to .Status.Conditions.
func (*PodWrapper) Conditions ¶
func (p *PodWrapper) Conditions(conditions []v1.PodCondition) *PodWrapper
Conditions sets `conditions` as .status.Conditions of the inner pod.
func (*PodWrapper) Container ¶
func (p *PodWrapper) Container(s string) *PodWrapper
Container appends a container into PodSpec of the inner pod.
func (*PodWrapper) ContainerPort ¶
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 ¶
func (p *PodWrapper) Containers(containers []v1.Container) *PodWrapper
Containers sets `containers` to the PodSpec of the inner pod.
func (*PodWrapper) CreationTimestamp ¶
func (p *PodWrapper) CreationTimestamp(t metav1.Time) *PodWrapper
CreationTimestamp sets the inner pod's CreationTimestamp.
func (*PodWrapper) GenerateName ¶
func (p *PodWrapper) GenerateName(s string) *PodWrapper
Name sets `s` as the name of the inner pod.
func (*PodWrapper) HostPort ¶
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 ¶
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 ¶
func (p *PodWrapper) Label(k, v string) *PodWrapper
Label sets a {k,v} pair to the inner pod label.
func (*PodWrapper) Labels ¶
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 ¶
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 ¶
func (p *PodWrapper) Name(s string) *PodWrapper
Name sets `s` as the name of the inner pod.
func (*PodWrapper) Namespace ¶
func (p *PodWrapper) Namespace(s string) *PodWrapper
Namespace sets `s` as the namespace of the inner pod.
func (*PodWrapper) Node ¶
func (p *PodWrapper) Node(s string) *PodWrapper
Node sets `s` as the nodeName of the inner pod.
func (*PodWrapper) NodeAffinityIn ¶
func (p *PodWrapper) NodeAffinityIn(key string, vals []string, t NodeSelectorType) *PodWrapper
NodeAffinityIn creates a HARD node affinity (with the operator In) and injects into the inner pod.
func (*PodWrapper) NodeAffinityNotIn ¶
func (p *PodWrapper) NodeAffinityNotIn(key string, vals []string) *PodWrapper
NodeAffinityNotIn creates a HARD node affinity (with MatchExpressions and the operator NotIn) and injects into the inner pod.
func (*PodWrapper) NodeSelector ¶
func (p *PodWrapper) NodeSelector(m map[string]string) *PodWrapper
NodeSelector sets `m` as the nodeSelector of the inner pod.
func (*PodWrapper) NominatedNodeName ¶
func (p *PodWrapper) NominatedNodeName(n string) *PodWrapper
NominatedNodeName sets `n` as the .Status.NominatedNodeName of the inner pod.
func (*PodWrapper) Obj ¶
func (p *PodWrapper) Obj() *v1.Pod
Obj returns the inner Pod.
func (*PodWrapper) Overhead ¶
func (p *PodWrapper) Overhead(rl v1.ResourceList) *PodWrapper
Overhead sets the give ResourceList to the inner pod
func (*PodWrapper) OwnerReference ¶
func (p *PodWrapper) OwnerReference(name string, gvk schema.GroupVersionKind) *PodWrapper
OwnerReference updates the owning controller of the pod.
func (*PodWrapper) PVC ¶
func (p *PodWrapper) PVC(name string) *PodWrapper
PVC creates a Volume with a PVC and injects into the inner pod.
func (*PodWrapper) Phase ¶
func (p *PodWrapper) Phase(phase v1.PodPhase) *PodWrapper
Phase sets `phase` as .status.Phase of the inner pod.
func (*PodWrapper) PodAffinity ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (p *PodWrapper) PodResourceClaims(podResourceClaims ...v1.PodResourceClaim) *PodWrapper
PodResourceClaims appends PodResourceClaims into PodSpec of the inner pod.
func (*PodWrapper) PreemptionPolicy ¶
func (p *PodWrapper) PreemptionPolicy(policy v1.PreemptionPolicy) *PodWrapper
PreemptionPolicy sets the give preemption policy to the inner pod.
func (*PodWrapper) Priority ¶
func (p *PodWrapper) Priority(val int32) *PodWrapper
Priority sets a priority value into PodSpec of the inner pod.
func (*PodWrapper) Req ¶
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 ¶
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) ResourceClaimStatuses ¶
func (p *PodWrapper) ResourceClaimStatuses(resourceClaimStatuses ...v1.PodResourceClaimStatus) *PodWrapper
PodResourceClaims appends claim statuses into PodSpec of the inner pod.
func (*PodWrapper) Resources ¶
func (p *PodWrapper) Resources(resources v1.ResourceRequirements) *PodWrapper
Resources sets requests and limits at pod-level.
func (*PodWrapper) SchedulerName ¶
func (p *PodWrapper) SchedulerName(s string) *PodWrapper
SchedulerName sets `s` as the scheduler name of the inner pod.
func (*PodWrapper) SchedulingGates ¶
func (p *PodWrapper) SchedulingGates(gates []string) *PodWrapper
SchedulingGates sets `gates` as additional SchedulerGates of the inner pod.
func (*PodWrapper) SidecarReq ¶
func (p *PodWrapper) SidecarReq(resMap map[v1.ResourceName]string) *PodWrapper
SidecarReq adds a new sidecar container to the inner pod with given resource map.
func (*PodWrapper) SpreadConstraint ¶
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 ¶
func (p *PodWrapper) StartTime(t metav1.Time) *PodWrapper
StartTime sets `t` as .status.startTime for the inner pod.
func (*PodWrapper) Terminating ¶
func (p *PodWrapper) Terminating() *PodWrapper
Terminating sets the inner pod's deletionTimestamp to current timestamp.
func (*PodWrapper) Toleration ¶
func (p *PodWrapper) Toleration(key string) *PodWrapper
Toleration creates a toleration (with the operator Exists) and injects into the inner pod.
func (*PodWrapper) Tolerations ¶
func (p *PodWrapper) Tolerations(tolerations []v1.Toleration) *PodWrapper
Tolerations sets `tolerations` as the tolerations of the inner pod.
func (*PodWrapper) UID ¶
func (p *PodWrapper) UID(s string) *PodWrapper
UID sets `s` as the UID of the inner pod.
func (*PodWrapper) Volume ¶
func (p *PodWrapper) Volume(volume v1.Volume) *PodWrapper
Volume creates volume and injects into the inner pod.
func (*PodWrapper) Volumes ¶
func (p *PodWrapper) Volumes(volumes []v1.Volume) *PodWrapper
Volumes set the volumes and inject into the inner pod.
func (*PodWrapper) ZeroTerminationGracePeriod ¶
func (p *PodWrapper) ZeroTerminationGracePeriod() *PodWrapper
ZeroTerminationGracePeriod sets the TerminationGracePeriodSeconds of the inner pod to zero.
type ResourceClaimWrapper ¶
type ResourceClaimWrapper struct{ resourceapi.ResourceClaim }
ResourceClaimWrapper wraps a ResourceClaim inside.
func FromResourceClaim ¶
func FromResourceClaim(other *resourceapi.ResourceClaim) *ResourceClaimWrapper
FromResourceClaim creates a ResourceClaim wrapper from some existing object.
func MakeResourceClaim ¶
func MakeResourceClaim() *ResourceClaimWrapper
MakeResourceClaim creates a ResourceClaim wrapper.
func (*ResourceClaimWrapper) Allocation ¶
func (wrapper *ResourceClaimWrapper) Allocation(allocation *resourceapi.AllocationResult) *ResourceClaimWrapper
Allocation sets the allocation of the inner object.
func (*ResourceClaimWrapper) Deleting ¶
func (wrapper *ResourceClaimWrapper) Deleting(time metav1.Time) *ResourceClaimWrapper
Deleting sets the deletion timestamp of the inner object.
func (*ResourceClaimWrapper) Name ¶
func (wrapper *ResourceClaimWrapper) Name(s string) *ResourceClaimWrapper
Name sets `s` as the name of the inner object.
func (*ResourceClaimWrapper) Namespace ¶
func (wrapper *ResourceClaimWrapper) Namespace(s string) *ResourceClaimWrapper
Namespace sets `s` as the namespace of the inner object.
func (*ResourceClaimWrapper) Obj ¶
func (wrapper *ResourceClaimWrapper) Obj() *resourceapi.ResourceClaim
Obj returns the inner ResourceClaim.
func (*ResourceClaimWrapper) OwnerReference ¶
func (wrapper *ResourceClaimWrapper) OwnerReference(name, uid string, gvk schema.GroupVersionKind) *ResourceClaimWrapper
OwnerReference updates the owning controller of the object.
func (*ResourceClaimWrapper) Request ¶
func (wrapper *ResourceClaimWrapper) Request(deviceClassName string) *ResourceClaimWrapper
Request adds one device request for the given device class.
func (*ResourceClaimWrapper) RequestWithPrioritizedList ¶
func (wrapper *ResourceClaimWrapper) RequestWithPrioritizedList(deviceClassNames ...string) *ResourceClaimWrapper
RequestWithPrioritizedList adds one device request with one subrequest per provided deviceClassName.
func (*ResourceClaimWrapper) ReservedFor ¶
func (wrapper *ResourceClaimWrapper) ReservedFor(consumers ...resourceapi.ResourceClaimConsumerReference) *ResourceClaimWrapper
ReservedFor sets that field of the inner object.
func (*ResourceClaimWrapper) ReservedForPod ¶
func (wrapper *ResourceClaimWrapper) ReservedForPod(podName string, podUID types.UID) *ResourceClaimWrapper
ReservedForPod sets that field of the inner object given information about one pod.
func (*ResourceClaimWrapper) UID ¶
func (wrapper *ResourceClaimWrapper) UID(s string) *ResourceClaimWrapper
UID sets `s` as the UID of the inner object.
type ResourceSliceWrapper ¶
type ResourceSliceWrapper struct { resourceapi.ResourceSlice }
func FromResourceSlice ¶
func FromResourceSlice(other *resourceapi.ResourceSlice) *ResourceSliceWrapper
FromResourceSlice creates a ResourceSlice wrapper from some existing object.
func MakeResourceSlice ¶
func MakeResourceSlice(nodeName, driverName string) *ResourceSliceWrapper
func (*ResourceSliceWrapper) Device ¶
func (wrapper *ResourceSliceWrapper) Device(name string, otherFields ...any) *ResourceSliceWrapper
Device extends the devices field of the inner object. The device must have a name and may have arbitrary additional fields.
func (*ResourceSliceWrapper) Devices ¶
func (wrapper *ResourceSliceWrapper) Devices(names ...string) *ResourceSliceWrapper
Devices sets the devices field of the inner object.
func (*ResourceSliceWrapper) Obj ¶
func (wrapper *ResourceSliceWrapper) Obj() *resourceapi.ResourceSlice
type StorageClassWrapper ¶
type StorageClassWrapper struct{ storagev1.StorageClass }
StorageClassWrapper wraps a StorageClass inside.
func MakeStorageClass ¶
func MakeStorageClass() *StorageClassWrapper
MakeStorageClass creates a StorageClass wrapper.
func (*StorageClassWrapper) AllowedTopologies ¶
func (s *StorageClassWrapper) AllowedTopologies(topologies []v1.TopologySelectorTerm) *StorageClassWrapper
AllowedTopologies sets `AllowedTopologies` of the inner StorageClass.
func (*StorageClassWrapper) Label ¶
func (s *StorageClassWrapper) Label(k, v string) *StorageClassWrapper
Label sets a {k,v} pair to the inner StorageClass label.
func (*StorageClassWrapper) Name ¶
func (s *StorageClassWrapper) Name(n string) *StorageClassWrapper
Name sets `n` as the name of the inner StorageClass.
func (*StorageClassWrapper) Obj ¶
func (s *StorageClassWrapper) Obj() *storagev1.StorageClass
Obj returns the inner StorageClass.
func (*StorageClassWrapper) Provisioner ¶
func (s *StorageClassWrapper) Provisioner(p string) *StorageClassWrapper
Provisoner sets p as the provisioner of the inner StorageClass.
func (*StorageClassWrapper) VolumeBindingMode ¶
func (s *StorageClassWrapper) VolumeBindingMode(mode storagev1.VolumeBindingMode) *StorageClassWrapper
VolumeBindingMode sets mode as the mode of the inner StorageClass.
type VolumeAttachmentWrapper ¶
type VolumeAttachmentWrapper struct{ storagev1.VolumeAttachment }
VolumeAttachmentWrapper wraps a VolumeAttachment inside.
func MakeVolumeAttachment ¶
func MakeVolumeAttachment() *VolumeAttachmentWrapper
MakeVolumeAttachment creates a VolumeAttachment wrapper.
func (*VolumeAttachmentWrapper) Attached ¶
func (c *VolumeAttachmentWrapper) Attached(attached bool) *VolumeAttachmentWrapper
func (*VolumeAttachmentWrapper) Attacher ¶
func (c *VolumeAttachmentWrapper) Attacher(attacher string) *VolumeAttachmentWrapper
func (*VolumeAttachmentWrapper) Name ¶
func (c *VolumeAttachmentWrapper) Name(n string) *VolumeAttachmentWrapper
Name sets `n` as the name of the inner VolumeAttachment.
func (*VolumeAttachmentWrapper) NodeName ¶
func (c *VolumeAttachmentWrapper) NodeName(nodeName string) *VolumeAttachmentWrapper
func (*VolumeAttachmentWrapper) Obj ¶
func (c *VolumeAttachmentWrapper) Obj() *storagev1.VolumeAttachment
Obj returns the inner VolumeAttachment.
func (*VolumeAttachmentWrapper) Source ¶
func (c *VolumeAttachmentWrapper) Source(source storagev1.VolumeAttachmentSource) *VolumeAttachmentWrapper
Source Files ¶
workload_prep.go wrappers.go
Directories ¶
Path | Synopsis |
---|---|
pkg/scheduler/testing/framework |
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 3 hours ago –
Tools for package owners.