testing

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ki = 1 << 10
	Mi = Ki * Ki
	Gi = Ki * Mi
)

Variables

This section is empty.

Functions

func BeNotFoundError added in v0.2.0

func BeNotFoundError() types.GomegaMatcher

func CheckLatestEvent

func CheckLatestEvent(ctx context.Context, k8sClient client.Client,
	eventReason string,
	eventType string, eventNote string) (bool, error)

CheckLatestEvent will return true if the latest event is as you want.

func PodSpecForRequest

func PodSpecForRequest(request map[corev1.ResourceName]string) corev1.PodSpec

Types

type AdmissionWrapper

type AdmissionWrapper struct{ kueue.Admission }

AdmissionWrapper wraps an Admission

func MakeAdmission

func MakeAdmission(cq string, podSetNames ...string) *AdmissionWrapper

func (*AdmissionWrapper) Flavor

func (*AdmissionWrapper) Obj

func (w *AdmissionWrapper) Obj() *kueue.Admission

type ClusterQueueWrapper

type ClusterQueueWrapper struct{ kueue.ClusterQueue }

ClusterQueueWrapper wraps a ClusterQueue.

func MakeClusterQueue

func MakeClusterQueue(name string) *ClusterQueueWrapper

MakeClusterQueue creates a wrapper for a ClusterQueue with a select-all NamespaceSelector.

func (*ClusterQueueWrapper) Cohort

func (c *ClusterQueueWrapper) Cohort(cohort string) *ClusterQueueWrapper

Cohort sets the borrowing cohort.

func (*ClusterQueueWrapper) NamespaceSelector

func (c *ClusterQueueWrapper) NamespaceSelector(s *metav1.LabelSelector) *ClusterQueueWrapper

NamespaceSelector sets the namespace selector.

func (*ClusterQueueWrapper) Obj

Obj returns the inner ClusterQueue.

func (*ClusterQueueWrapper) QueueingStrategy

func (c *ClusterQueueWrapper) QueueingStrategy(strategy kueue.QueueingStrategy) *ClusterQueueWrapper

QueueingStrategy sets the queueing strategy in this ClusterQueue.

func (*ClusterQueueWrapper) Resource

Resource adds a resource with flavors.

type FlavorWrapper

type FlavorWrapper struct{ kueue.Flavor }

FlavorWrapper wraps a resource flavor.

func MakeFlavor

func MakeFlavor(rf, min string) *FlavorWrapper

MakeFlavor creates a wrapper for a resource flavor.

func (*FlavorWrapper) Max

func (f *FlavorWrapper) Max(c string) *FlavorWrapper

Max updates the flavor max.

func (*FlavorWrapper) Obj

func (f *FlavorWrapper) Obj() *kueue.Flavor

Obj returns the inner flavor.

type JobWrapper

type JobWrapper struct{ batchv1.Job }

JobWrapper wraps a Job.

func MakeJob

func MakeJob(name, ns string) *JobWrapper

MakeJob creates a wrapper for a suspended job with a single container and parallelism=1.

func (*JobWrapper) NodeSelector

func (j *JobWrapper) NodeSelector(k, v string) *JobWrapper

NodeSelector adds a node selector to the job.

func (*JobWrapper) Obj

func (j *JobWrapper) Obj() *batchv1.Job

Obj returns the inner Job.

func (*JobWrapper) Parallelism

func (j *JobWrapper) Parallelism(p int32) *JobWrapper

Parallelism updates job parallelism.

func (*JobWrapper) PriorityClass

func (j *JobWrapper) PriorityClass(pc string) *JobWrapper

PriorityClass updates job priorityclass.

func (*JobWrapper) Queue

func (j *JobWrapper) Queue(queue string) *JobWrapper

Queue updates the queue name of the job

func (*JobWrapper) Request

func (j *JobWrapper) Request(r corev1.ResourceName, v string) *JobWrapper

Request adds a resource request to the default container.

func (*JobWrapper) Suspend

func (j *JobWrapper) Suspend(s bool) *JobWrapper

Suspend updates the suspend status of the job

func (*JobWrapper) Toleration

func (j *JobWrapper) Toleration(t corev1.Toleration) *JobWrapper

Toleration adds a toleration to the job.

type LocalQueueWrapper added in v0.2.0

type LocalQueueWrapper struct{ kueue.LocalQueue }

LocalQueueWrapper wraps a Queue.

func MakeLocalQueue added in v0.2.0

func MakeLocalQueue(name, ns string) *LocalQueueWrapper

MakeLocalQueue creates a wrapper for a LocalQueue.

func (*LocalQueueWrapper) ClusterQueue added in v0.2.0

func (q *LocalQueueWrapper) ClusterQueue(c string) *LocalQueueWrapper

ClusterQueue updates the clusterQueue the queue points to.

func (*LocalQueueWrapper) Obj added in v0.2.0

Obj returns the inner LocalQueue.

func (*LocalQueueWrapper) PendingWorkloads added in v0.2.0

func (q *LocalQueueWrapper) PendingWorkloads(n int32) *LocalQueueWrapper

PendingWorkloads updates the pendingWorkloads in status.

type PriorityClassWrapper

type PriorityClassWrapper struct {
	schedulingv1.PriorityClass
}

PriorityClassWrapper wraps a PriorityClass.

func MakePriorityClass

func MakePriorityClass(name string) *PriorityClassWrapper

MakePriorityClass creates a wrapper for a PriorityClass.

func (*PriorityClassWrapper) Obj

Obj returns the inner PriorityClass.

func (*PriorityClassWrapper) PriorityValue

func (p *PriorityClassWrapper) PriorityValue(v int32) *PriorityClassWrapper

PriorityValue update value of PriorityClass。

type ResourceFlavorWrapper

type ResourceFlavorWrapper struct{ kueue.ResourceFlavor }

ResourceFlavorWrapper wraps a ResourceFlavor.

func MakeResourceFlavor

func MakeResourceFlavor(name string) *ResourceFlavorWrapper

MakeResourceFlavor creates a wrapper for a ResourceFlavor.

func (*ResourceFlavorWrapper) Label

Label adds a label to the ResourceFlavor.

func (*ResourceFlavorWrapper) MultiLabels added in v0.2.0

func (rf *ResourceFlavorWrapper) MultiLabels(kv map[string]string) *ResourceFlavorWrapper

MultiLabels adds multi labels to the ResourceFlavor.

func (*ResourceFlavorWrapper) Obj

Obj returns the inner ResourceFlavor.

func (*ResourceFlavorWrapper) Taint

Taint adds a taint to the ResourceFlavor.

type ResourceWrapper

type ResourceWrapper struct{ kueue.Resource }

ResourceWrapper wraps a resource.

func MakeResource

func MakeResource(name corev1.ResourceName) *ResourceWrapper

MakeResource creates a wrapper for a resource.

func (*ResourceWrapper) Flavor

Flavor appends a flavor.

func (*ResourceWrapper) Obj

func (r *ResourceWrapper) Obj() *kueue.Resource

Obj returns the inner resource.

type RuntimeClassWrapper added in v0.2.0

type RuntimeClassWrapper struct{ nodev1.RuntimeClass }

RuntimeClassWrapper wraps a RuntimeClass.

func MakeRuntimeClass added in v0.2.0

func MakeRuntimeClass(name, handler string) *RuntimeClassWrapper

MakeRuntimeClass creates a wrapper for a Runtime.

func (*RuntimeClassWrapper) Obj added in v0.2.0

Obj returns the inner flavor.

func (*RuntimeClassWrapper) PodOverhead added in v0.2.0

func (rc *RuntimeClassWrapper) PodOverhead(resources corev1.ResourceList) *RuntimeClassWrapper

PodOverhead adds a Overhead to the RuntimeClass.

type WorkloadWrapper

type WorkloadWrapper struct{ kueue.Workload }

func MakeWorkload

func MakeWorkload(name, ns string) *WorkloadWrapper

MakeWorkload creates a wrapper for a Workload with a single pod with a single container.

func (*WorkloadWrapper) Admit

func (*WorkloadWrapper) Creation

func (w *WorkloadWrapper) Creation(t time.Time) *WorkloadWrapper

func (*WorkloadWrapper) NodeSelector added in v0.2.0

func (w *WorkloadWrapper) NodeSelector(kv map[string]string) *WorkloadWrapper

func (*WorkloadWrapper) Obj

func (w *WorkloadWrapper) Obj() *kueue.Workload

func (*WorkloadWrapper) PodSets added in v0.2.0

func (w *WorkloadWrapper) PodSets(podSets []kueue.PodSet) *WorkloadWrapper

func (*WorkloadWrapper) Priority added in v0.2.0

func (w *WorkloadWrapper) Priority(priority *int32) *WorkloadWrapper

func (*WorkloadWrapper) PriorityClass

func (w *WorkloadWrapper) PriorityClass(priorityClassName string) *WorkloadWrapper

func (*WorkloadWrapper) Queue

func (w *WorkloadWrapper) Queue(q string) *WorkloadWrapper

func (*WorkloadWrapper) Request

func (*WorkloadWrapper) RuntimeClass added in v0.2.0

func (w *WorkloadWrapper) RuntimeClass(name string) *WorkloadWrapper

func (*WorkloadWrapper) Toleration added in v0.2.0

Jump to

Keyboard shortcuts

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