Documentation ¶
Index ¶
- func CreatePodGroup(namespace, name string, minMember int32, priorityClassName string) *schedulingv1a1.PodGroup
- func MakeNodesAndPods(existingPodsNum, allNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node)
- func MakeNodesAndPodsForEvenPodsSpread(labels map[string]string, existingPodsNum, allNodesNum, filteredNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node, filteredNodes []*v1.Node)
- func MakeNodesAndPodsForPodAffinity(existingPodsNum, allNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node)
- func NewFakeDeploymentLister(deploys []*appsv1.Deployment) appv1listers.DeploymentLister
- func NewFakeDeploymentNamespaceLister(deploys []*appsv1.Deployment) appv1listers.DeploymentNamespaceLister
- func NewFakePodDisruptionBudgetLister(pdbs []*policy.PodDisruptionBudget) policylisters.PodDisruptionBudgetLister
- func NewFakePodDisruptionBudgetNamespaceLister(pdbs []*policy.PodDisruptionBudget) policylisters.PodDisruptionBudgetNamespaceLister
- func NewFakePodGroupLister(podGroups []*schedulingv1a1.PodGroup) schedulingv1a1listers.PodGroupLister
- func NewFakePodGroupNamespaceLister(podGroups []*schedulingv1a1.PodGroup) schedulingv1a1listers.PodGroupNamespaceLister
- func NewFakePodLister(pods []*v1.Pod) corelisters.PodLister
- func NewFakePodNamespaceLister(pods []*v1.Pod) corelisters.PodNamespaceLister
- func NewFakePriorityClassLister(pcs []*schedulingv1.PriorityClass) fakePriorityClassLister
- type DeploymentWrapper
- func (dp *DeploymentWrapper) Annotation(key, value string) *DeploymentWrapper
- func (dp *DeploymentWrapper) Name(n string) *DeploymentWrapper
- func (dp *DeploymentWrapper) Namespace(n string) *DeploymentWrapper
- func (dp *DeploymentWrapper) Obj() *appsv1.Deployment
- func (dp *DeploymentWrapper) Replicas(n uint) *DeploymentWrapper
- type 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 NodeAffinityKind
- type NodeSelectorWrapper
- type NodeWrapper
- func (n *NodeWrapper) CNRCapacity(resources map[v1.ResourceName]string) *NodeWrapper
- func (n *NodeWrapper) CNRObj() *katalystv1alpha1.CustomNodeResource
- func (n *NodeWrapper) Capacity(resources map[v1.ResourceName]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) NodeUID(s string) *NodeWrapper
- func (n *NodeWrapper) Obj() *v1.Node
- type PDBWrapper
- func (p *PDBWrapper) DisruptionsAllowed(n int32) *PDBWrapper
- func (p *PDBWrapper) Label(k, v string) *PDBWrapper
- func (p *PDBWrapper) Name(name string) *PDBWrapper
- func (p *PDBWrapper) Namespace(namespace string) *PDBWrapper
- func (p *PDBWrapper) Obj() *policy.PodDisruptionBudget
- func (p *PDBWrapper) Selector(selector *metav1.LabelSelector) *PDBWrapper
- type PersistentVolumeClaimLister
- type PodAffinityKind
- type PodGroupWrapper
- func (pg *PodGroupWrapper) MinMember(n uint) *PodGroupWrapper
- func (pg *PodGroupWrapper) Name(n string) *PodGroupWrapper
- func (pg *PodGroupWrapper) Namespace(n string) *PodGroupWrapper
- func (pg *PodGroupWrapper) Obj() *schedulingv1a1.PodGroup
- func (pg *PodGroupWrapper) Phase(n schedulingv1a1.PodGroupPhase) *PodGroupWrapper
- func (pg *PodGroupWrapper) ProrityClassName(n string) *PodGroupWrapper
- type PodWrapper
- func (p *PodWrapper) Annotation(k, v string) *PodWrapper
- func (p *PodWrapper) Container(s string) *PodWrapper
- func (p *PodWrapper) ControllerRef(ref metav1.OwnerReference) *PodWrapper
- func (p *PodWrapper) Label(k, v 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, kind NodeAffinityKind) *PodWrapper
- func (p *PodWrapper) NodeAffinityNotIn(key string, vals []string, kind NodeAffinityKind) *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) PodAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PodAntiAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
- func (p *PodWrapper) PreemptionPolicy(policy v1.PreemptionPolicy) *PodWrapper
- func (p *PodWrapper) Priority(val int32) *PodWrapper
- func (p *PodWrapper) PriorityClassName(n string) *PodWrapper
- func (p *PodWrapper) Req(resMap map[v1.ResourceName]string) *PodWrapper
- func (p *PodWrapper) ResourceVersion(v string) *PodWrapper
- func (p *PodWrapper) SchedulerName(s string) *PodWrapper
- func (p *PodWrapper) SetCreationTimestampAt(creation time.Time) *PodWrapper
- func (p *PodWrapper) SpreadConstraint(maxSkew int, tpKey string, mode v1.UnsatisfiableConstraintAction, ...) *PodWrapper
- func (p *PodWrapper) StartTime(t metav1.Time) *PodWrapper
- func (p *PodWrapper) Terminating() *PodWrapper
- func (p *PodWrapper) UID(s string) *PodWrapper
- func (p *PodWrapper) ZeroTerminationGracePeriod() *PodWrapper
- type PriorityClassWrapper
- func (p *PriorityClassWrapper) Annotation(k, v string) *PriorityClassWrapper
- func (p *PriorityClassWrapper) Name(n string) *PriorityClassWrapper
- func (p *PriorityClassWrapper) Obj() *scheduling.PriorityClass
- func (p *PriorityClassWrapper) SetPreemptionPolicy(policy v1.PreemptionPolicy) *PriorityClassWrapper
- func (p *PriorityClassWrapper) Value(n int32) *PriorityClassWrapper
- type ReplicaSetWrapper
- type ReservationWrapper
- type StorageClassLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePodGroup ¶
func CreatePodGroup(namespace, name string, minMember int32, priorityClassName string) *schedulingv1a1.PodGroup
func MakeNodesAndPods ¶
func MakeNodesAndPods(existingPodsNum, allNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node)
MakeNodesAndPods serves as a testing helper to generate regular Nodes and Pods that don't use any advanced scheduling features.
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.
func MakeNodesAndPodsForPodAffinity ¶
func MakeNodesAndPodsForPodAffinity(existingPodsNum, allNodesNum int) (existingPods []*v1.Pod, allNodes []*v1.Node)
MakeNodesAndPodsForPodAffinity serves as a testing helper for Pod(Anti)Affinity feature. It builds a fake cluster containing running Pods and Nodes. For simplicity, the Nodes will be labelled with "region", "zone" and "node". Nodes[i] will be applied with: - "region": "region" + i%3 - "zone": "zone" + i%10 - "node": "node" + i The Pods will be applied with various combinations of PodAffinity and PodAntiAffinity terms.
func NewFakeDeploymentLister ¶
func NewFakeDeploymentLister(deploys []*appsv1.Deployment) appv1listers.DeploymentLister
func NewFakeDeploymentNamespaceLister ¶
func NewFakeDeploymentNamespaceLister(deploys []*appsv1.Deployment) appv1listers.DeploymentNamespaceLister
func NewFakePodDisruptionBudgetLister ¶
func NewFakePodDisruptionBudgetLister(pdbs []*policy.PodDisruptionBudget) policylisters.PodDisruptionBudgetLister
func NewFakePodDisruptionBudgetNamespaceLister ¶
func NewFakePodDisruptionBudgetNamespaceLister(pdbs []*policy.PodDisruptionBudget) policylisters.PodDisruptionBudgetNamespaceLister
func NewFakePodGroupLister ¶
func NewFakePodGroupLister(podGroups []*schedulingv1a1.PodGroup) schedulingv1a1listers.PodGroupLister
func NewFakePodGroupNamespaceLister ¶
func NewFakePodGroupNamespaceLister(podGroups []*schedulingv1a1.PodGroup) schedulingv1a1listers.PodGroupNamespaceLister
func NewFakePodLister ¶
func NewFakePodLister(pods []*v1.Pod) corelisters.PodLister
func NewFakePodNamespaceLister ¶
func NewFakePodNamespaceLister(pods []*v1.Pod) corelisters.PodNamespaceLister
func NewFakePriorityClassLister ¶
func NewFakePriorityClassLister(pcs []*schedulingv1.PriorityClass) fakePriorityClassLister
Types ¶
type DeploymentWrapper ¶
type DeploymentWrapper struct {
appsv1.Deployment
}
NodeWrapper wraps a Node inside.
func (*DeploymentWrapper) Annotation ¶
func (dp *DeploymentWrapper) Annotation(key, value string) *DeploymentWrapper
func (*DeploymentWrapper) Name ¶
func (dp *DeploymentWrapper) Name(n string) *DeploymentWrapper
set 'a' as .Name of the inner Deployment obj.
func (*DeploymentWrapper) Namespace ¶
func (dp *DeploymentWrapper) Namespace(n string) *DeploymentWrapper
func (*DeploymentWrapper) Obj ¶
func (dp *DeploymentWrapper) Obj() *appsv1.Deployment
Obj returns the inner deploy.
func (*DeploymentWrapper) Replicas ¶
func (dp *DeploymentWrapper) Replicas(n uint) *DeploymentWrapper
set n as .Spec.Replicas of the inner deploy obj.
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 NodeAffinityKind ¶
type NodeAffinityKind int
const ( NodeAffinityWithRequiredReq NodeAffinityKind = iota NodeAffinityWithPreferredReq )
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) *NodeSelectorWrapper
In injects a matchExpression (with an operator IN) as a selectorTerm to the inner nodeSelector. NOTE: appended selecterTerms 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 ¶
type NodeWrapper struct { v1.Node `json:"node"` katalystv1alpha1.CustomNodeResource `json:"cnr"` }
NodeWrapper wraps a Node inside.
func (*NodeWrapper) CNRCapacity ¶
func (n *NodeWrapper) CNRCapacity(resources map[v1.ResourceName]string) *NodeWrapper
func (*NodeWrapper) CNRObj ¶
func (n *NodeWrapper) CNRObj() *katalystv1alpha1.CustomNodeResource
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) 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) NodeUID ¶
func (n *NodeWrapper) NodeUID(s string) *NodeWrapper
NodeUID sets `s` as the UID of the inner pod.
type PDBWrapper ¶
type PDBWrapper struct{ policy.PodDisruptionBudget }
PDBWrapper wrappers a pdb inside.
func (*PDBWrapper) DisruptionsAllowed ¶
func (p *PDBWrapper) DisruptionsAllowed(n int32) *PDBWrapper
set 'a' as .Status.DisruptionsAllowed of the inner pdb obj.
func (*PDBWrapper) Label ¶
func (p *PDBWrapper) Label(k, v string) *PDBWrapper
add 'k,v' to the selector of the inner pdb.
func (*PDBWrapper) Name ¶
func (p *PDBWrapper) Name(name string) *PDBWrapper
func (*PDBWrapper) Namespace ¶
func (p *PDBWrapper) Namespace(namespace string) *PDBWrapper
func (*PDBWrapper) Obj ¶
func (p *PDBWrapper) Obj() *policy.PodDisruptionBudget
Obj returns the inner pdb.
func (*PDBWrapper) Selector ¶
func (p *PDBWrapper) Selector(selector *metav1.LabelSelector) *PDBWrapper
set 'selector' as .Spec.Selector of the inner pdb.
type PersistentVolumeClaimLister ¶
type PersistentVolumeClaimLister []v1.PersistentVolumeClaim
PersistentVolumeClaimLister declares a []v1.PersistentVolumeClaim type for testing.
func (PersistentVolumeClaimLister) List ¶
func (pvcs PersistentVolumeClaimLister) List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error)
List gets PVC matching the namespace and PVC ID.
func (PersistentVolumeClaimLister) PersistentVolumeClaims ¶
func (pvcs PersistentVolumeClaimLister) PersistentVolumeClaims(namespace string) corelisters.PersistentVolumeClaimNamespaceLister
PersistentVolumeClaims returns a fake PersistentVolumeClaimLister object.
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 PodGroupWrapper ¶
type PodGroupWrapper struct {
schedulingv1a1.PodGroup
}
PodGroupWrapper wraps a PodGroup inside.
func (*PodGroupWrapper) MinMember ¶
func (pg *PodGroupWrapper) MinMember(n uint) *PodGroupWrapper
set n as .Spec.MinMember of the inner PodGroup obj.
func (*PodGroupWrapper) Name ¶
func (pg *PodGroupWrapper) Name(n string) *PodGroupWrapper
set 'a' as .Name of the inner PodGroup obj.
func (*PodGroupWrapper) Namespace ¶
func (pg *PodGroupWrapper) Namespace(n string) *PodGroupWrapper
func (*PodGroupWrapper) Obj ¶
func (pg *PodGroupWrapper) Obj() *schedulingv1a1.PodGroup
Obj returns the inner pod group.
func (*PodGroupWrapper) Phase ¶
func (pg *PodGroupWrapper) Phase(n schedulingv1a1.PodGroupPhase) *PodGroupWrapper
func (*PodGroupWrapper) ProrityClassName ¶
func (pg *PodGroupWrapper) ProrityClassName(n string) *PodGroupWrapper
set n as .Spec.PriorityClassName of the inner PodGroup obj.
type PodWrapper ¶
PodWrapper wraps a Pod inside.
func (*PodWrapper) Annotation ¶
func (p *PodWrapper) Annotation(k, v string) *PodWrapper
Annotation sets a {k,v} pair to 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) ControllerRef ¶
func (p *PodWrapper) ControllerRef(ref metav1.OwnerReference) *PodWrapper
func (*PodWrapper) Label ¶
func (p *PodWrapper) Label(k, v string) *PodWrapper
Label sets a {k,v} pair to the inner pod.
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, kind NodeAffinityKind) *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, kind NodeAffinityKind) *PodWrapper
NodeAffinityNotIn creates a HARD node affinity (with 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) PodAffinityExists ¶
func (p *PodWrapper) PodAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
PodAffinityExists creates an PodAffinity with the operator "Exists" and injects into the inner pod.
func (*PodWrapper) PodAntiAffinityExists ¶
func (p *PodWrapper) PodAntiAffinityExists(labelKey, topologyKey string, kind PodAffinityKind) *PodWrapper
PodAntiAffinityExists creates an PodAntiAffinity with the operator "Exists" and injects into 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) PriorityClassName ¶
func (p *PodWrapper) PriorityClassName(n string) *PodWrapper
PriorityClassName sets 'n' as .Spec.PriorityClassName to the inner pod.
func (*PodWrapper) Req ¶
func (p *PodWrapper) Req(resMap map[v1.ResourceName]string) *PodWrapper
Req adds a new container to the inner pod with given resource map.
func (*PodWrapper) ResourceVersion ¶
func (p *PodWrapper) ResourceVersion(v string) *PodWrapper
func (*PodWrapper) SchedulerName ¶
func (p *PodWrapper) SchedulerName(s string) *PodWrapper
SchedulerName sets `s` as the scheduler name of the inner pod.
func (*PodWrapper) SetCreationTimestampAt ¶
func (p *PodWrapper) SetCreationTimestampAt(creation time.Time) *PodWrapper
func (*PodWrapper) SpreadConstraint ¶
func (p *PodWrapper) SpreadConstraint(maxSkew int, tpKey string, mode v1.UnsatisfiableConstraintAction, selector *metav1.LabelSelector) *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) UID ¶
func (p *PodWrapper) UID(s string) *PodWrapper
UID sets `s` as the UID of the inner pod.
func (*PodWrapper) ZeroTerminationGracePeriod ¶
func (p *PodWrapper) ZeroTerminationGracePeriod() *PodWrapper
ZeroTerminationGracePeriod sets the TerminationGracePeriodSeconds of the inner pod to zero.
type PriorityClassWrapper ¶
type PriorityClassWrapper struct{ scheduling.PriorityClass }
PriorityClassWrapper wrappers a PriorityClass inside.
func MakePriorityClass ¶
func MakePriorityClass() *PriorityClassWrapper
MakePriorityClass creates a PriorityClass wrapper.
func (*PriorityClassWrapper) Annotation ¶
func (p *PriorityClassWrapper) Annotation(k, v string) *PriorityClassWrapper
func (*PriorityClassWrapper) Name ¶
func (p *PriorityClassWrapper) Name(n string) *PriorityClassWrapper
set 'a' as .Name of the inner PriorityClass obj.
func (*PriorityClassWrapper) Obj ¶
func (p *PriorityClassWrapper) Obj() *scheduling.PriorityClass
Obj returns the inner pdb.
func (*PriorityClassWrapper) SetPreemptionPolicy ¶
func (p *PriorityClassWrapper) SetPreemptionPolicy(policy v1.PreemptionPolicy) *PriorityClassWrapper
func (*PriorityClassWrapper) Value ¶
func (p *PriorityClassWrapper) Value(n int32) *PriorityClassWrapper
set 'n' as .PriorityClass.Value of the inner PriorityClass obj.
type ReplicaSetWrapper ¶
type ReplicaSetWrapper struct {
appsv1.ReplicaSet
}
ReplicaSetWrapper wraps a ReplicaSet inside.
func MakeReplicaSet ¶
func MakeReplicaSet() *ReplicaSetWrapper
MakeReplicaSet creates a replicaset wrapper.
func (*ReplicaSetWrapper) Label ¶
func (rs *ReplicaSetWrapper) Label(k, v string) *ReplicaSetWrapper
Label applies a {k,v} label pair to the inner replicaset.
func (*ReplicaSetWrapper) Name ¶
func (rs *ReplicaSetWrapper) Name(n string) *ReplicaSetWrapper
set 'a' as .Name of the inner ReplicaSet obj.
func (*ReplicaSetWrapper) Namespace ¶
func (rs *ReplicaSetWrapper) Namespace(n string) *ReplicaSetWrapper
func (*ReplicaSetWrapper) Obj ¶
func (rs *ReplicaSetWrapper) Obj() *appsv1.ReplicaSet
Obj returns the inner replicaset.
type ReservationWrapper ¶
type ReservationWrapper struct {
schedulingv1a1.Reservation
}
func MakeReservation ¶
func MakeReservation() *ReservationWrapper
func WrapReservation ¶
func WrapReservation(prr *schedulingv1a1.Reservation) *ReservationWrapper
func (*ReservationWrapper) CreateTime ¶
func (prr *ReservationWrapper) CreateTime(createTime metav1.Time) *ReservationWrapper
func (*ReservationWrapper) Obj ¶
func (prr *ReservationWrapper) Obj() *schedulingv1a1.Reservation
func (*ReservationWrapper) SetStatus ¶
func (prr *ReservationWrapper) SetStatus(status schedulingv1a1.ReservationStatus) *ReservationWrapper
type StorageClassLister ¶
type StorageClassLister []storagev1.StorageClass
StorageClassLister declares a []storagev1.StorageClass type for testing.
func (StorageClassLister) Get ¶
func (classes StorageClassLister) Get(name string) (*storagev1.StorageClass, error)
Get returns a fake storage class object in the fake storage classes by name.
func (StorageClassLister) List ¶
func (classes StorageClassLister) List(selector labels.Selector) ([]*storagev1.StorageClass, error)
List lists all StorageClass in the indexer.