testing

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestPodSpec = corev1.PodSpec{
	RestartPolicy: "Never",
	Containers: []corev1.Container{
		{
			Name:  "test-container",
			Image: "busybox:latest",
		},
	},
}

TestPodSpec is the default pod spec used for testing.

Functions

This section is empty.

Types

type JobSetWrapper

type JobSetWrapper struct {
	jobset.JobSet
}

JobSetWrapper wraps a JobSet.

func MakeJobSet

func MakeJobSet(name, ns string) *JobSetWrapper

MakeJobSet creates a wrapper for a JobSet.

func (*JobSetWrapper) CompletedCondition added in v0.5.0

func (j *JobSetWrapper) CompletedCondition(completedAt metav1.Time) *JobSetWrapper

CompletedCondition adds a JobSetCompleted condition to the JobSet Status.

func (*JobSetWrapper) Conditions added in v0.5.0

func (j *JobSetWrapper) Conditions(conditions []metav1.Condition) *JobSetWrapper

Conditions sets the value of jobSet.status.conditions

func (*JobSetWrapper) Coordinator added in v0.6.0

func (j *JobSetWrapper) Coordinator(coordinator *jobset.Coordinator) *JobSetWrapper

Coordinator sets the Coordinator field on the JobSet spec.

func (*JobSetWrapper) DeletionTimestamp added in v0.5.0

func (j *JobSetWrapper) DeletionTimestamp(deletionTimestamp *metav1.Time) *JobSetWrapper

func (*JobSetWrapper) EnableDNSHostnames added in v0.2.0

func (j *JobSetWrapper) EnableDNSHostnames(val bool) *JobSetWrapper

EnableDNSHostnames sets the value of JobSet.Network.EnableDNSHostnames.

func (*JobSetWrapper) FailedCondition added in v0.5.0

func (j *JobSetWrapper) FailedCondition(failedAt metav1.Time) *JobSetWrapper

FailedCondition adds a JobSetFailed condition to the JobSet Status.

func (*JobSetWrapper) FailurePolicy

func (j *JobSetWrapper) FailurePolicy(policy *jobset.FailurePolicy) *JobSetWrapper

FailurePolicy sets the value of jobSet.spec.failurePolicy

func (*JobSetWrapper) Finalizers added in v0.6.0

func (j *JobSetWrapper) Finalizers(finalizers []string) *JobSetWrapper

func (*JobSetWrapper) ManagedBy added in v0.5.0

func (j *JobSetWrapper) ManagedBy(managedBy string) *JobSetWrapper

ManagedBy sets the value of jobSet.spec.managedBy

func (*JobSetWrapper) NetworkSubdomain added in v0.2.0

func (j *JobSetWrapper) NetworkSubdomain(val string) *JobSetWrapper

NetworkSubdomain sets the value of JobSet.Network.Subdomain

func (*JobSetWrapper) Obj

func (j *JobSetWrapper) Obj() *jobset.JobSet

Obj returns the inner JobSet.

func (*JobSetWrapper) PublishNotReadyAddresses added in v0.6.0

func (j *JobSetWrapper) PublishNotReadyAddresses(val bool) *JobSetWrapper

PublishNotReadyAddresses sets the value of JobSet.Network.PublishNotReadyAddresses.

func (*JobSetWrapper) ReplicatedJob

func (j *JobSetWrapper) ReplicatedJob(job jobset.ReplicatedJob) *JobSetWrapper

ReplicatedJob adds a single ReplicatedJob to the JobSet.

func (*JobSetWrapper) SetAnnotations

func (j *JobSetWrapper) SetAnnotations(annotations map[string]string) *JobSetWrapper

SetAnnotations sets the value of the jobSet.metadata.annotations.

func (*JobSetWrapper) SetGenerateName added in v0.3.2

func (j *JobSetWrapper) SetGenerateName(namePrefix string) *JobSetWrapper

SetGenerateName sets the JobSet name.

func (*JobSetWrapper) SetLabels added in v0.4.0

func (j *JobSetWrapper) SetLabels(labels map[string]string) *JobSetWrapper

SetLabels sets the value of the jobSet.metadata.labels.

func (*JobSetWrapper) StartupPolicy added in v0.4.0

func (j *JobSetWrapper) StartupPolicy(policy *jobset.StartupPolicy) *JobSetWrapper

StartupPolicy sets the value of jobSet.spec.startupPolicy

func (*JobSetWrapper) SuccessPolicy added in v0.2.0

func (j *JobSetWrapper) SuccessPolicy(policy *jobset.SuccessPolicy) *JobSetWrapper

SuccessPolicy sets the value of jobSet.spec.successPolicy

func (*JobSetWrapper) Suspend

func (j *JobSetWrapper) Suspend(suspend bool) *JobSetWrapper

Suspend adds a suspend flag to JobSet

func (*JobSetWrapper) TTLSecondsAfterFinished added in v0.5.0

func (j *JobSetWrapper) TTLSecondsAfterFinished(seconds int32) *JobSetWrapper

TTLSecondsAfterFinished sets the value of JobSet.Spec.TTLSecondsAfterFinished

func (*JobSetWrapper) TerminalState added in v0.6.0

func (j *JobSetWrapper) TerminalState(terminalState jobset.JobSetConditionType) *JobSetWrapper

TerminalState sets the value of JobSet.Status.TerminalState.

type JobTemplateWrapper

type JobTemplateWrapper struct {
	batchv1.JobTemplateSpec
}

JobTemplateWrapper wraps a JobTemplateSpec.

func MakeJobTemplate

func MakeJobTemplate(name, ns string) *JobTemplateWrapper

MakeJobTemplate creates a wrapper for a JobTemplateSpec.

func (*JobTemplateWrapper) CompletionMode

CompletionMode sets the value of job.spec.completionMode

func (*JobTemplateWrapper) Obj

Obj returns the inner batchv1.JobTemplateSpec

func (*JobTemplateWrapper) PodFailurePolicy added in v0.6.0

func (j *JobTemplateWrapper) PodFailurePolicy(policy *batchv1.PodFailurePolicy) *JobTemplateWrapper

PodFailurePolicy sets the pod failure policy on the job template.

func (*JobTemplateWrapper) PodSpec

func (j *JobTemplateWrapper) PodSpec(podSpec corev1.PodSpec) *JobTemplateWrapper

PodSpec sets the pod spec in a Job template.

func (*JobTemplateWrapper) PodTemplateSpec added in v0.5.2

func (j *JobTemplateWrapper) PodTemplateSpec(podTemplateSpec corev1.PodTemplateSpec) *JobTemplateWrapper

PodTemplateSpec sets the pod template spec in a Job spec.

func (*JobTemplateWrapper) SetAnnotations added in v0.4.0

func (j *JobTemplateWrapper) SetAnnotations(annotations map[string]string) *JobTemplateWrapper

SetAnnotations sets the annotations on the Job template.

type JobWrapper

type JobWrapper struct {
	batchv1.Job
}

JobWrapper wraps a Job.

func MakeJob

func MakeJob(jobName, ns string) *JobWrapper

MakeJob creates a wrapper for a Job.

func (*JobWrapper) Active added in v0.2.0

func (j *JobWrapper) Active(active int32) *JobWrapper

Active sets the job status active.

func (*JobWrapper) Affinity

func (j *JobWrapper) Affinity(affinity *corev1.Affinity) *JobWrapper

Affinity sets the pod affinities/anti-affinities for the pod template spec.

func (*JobWrapper) Completions added in v0.2.0

func (j *JobWrapper) Completions(completions int32) *JobWrapper

Completions sets the job spec completions.

func (*JobWrapper) JobAnnotations

func (j *JobWrapper) JobAnnotations(annotations map[string]string) *JobWrapper

JobAnnotations merges the given annotations to the existing Job annotations. Duplicate keys will be overwritten by the new annotations (given in the function parameter).

func (*JobWrapper) JobLabels

func (j *JobWrapper) JobLabels(labels map[string]string) *JobWrapper

JobLabels merges the given labels to the existing Job labels. Duplicate keys will be overwritten by the new annotations (given in the function parameter).

func (*JobWrapper) NodeSelector added in v0.3.0

func (j *JobWrapper) NodeSelector(nodeSelector map[string]string) *JobWrapper

NodeSelector sets the node selector.

func (*JobWrapper) Obj

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

Obj returns the wrapped Job.

func (*JobWrapper) Parallelism added in v0.2.0

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

Parallelism sets the job spec parallelism.

func (*JobWrapper) PodAnnotations

func (j *JobWrapper) PodAnnotations(annotations map[string]string) *JobWrapper

PodAnnotations merges the given annotations to the existing Pod annotations. Duplicate keys will be overwritten by the new annotations (given in the function parameter).

func (*JobWrapper) PodLabels

func (j *JobWrapper) PodLabels(labels map[string]string) *JobWrapper

PodLabels merges the given labels to the existing Pod labels. Duplicate keys will be overwritten by the new annotations (given in the function parameter).

func (*JobWrapper) PodSpec

func (j *JobWrapper) PodSpec(podSpec corev1.PodSpec) *JobWrapper

PodSpec sets the pod template spec.

func (*JobWrapper) Ready added in v0.2.0

func (j *JobWrapper) Ready(ready int32) *JobWrapper

Ready sets the job status ready.

func (*JobWrapper) Subdomain

func (j *JobWrapper) Subdomain(subdomain string) *JobWrapper

Subdomain sets the pod template spec subdomain.

func (*JobWrapper) Succeeded added in v0.2.0

func (j *JobWrapper) Succeeded(succeeded int32) *JobWrapper

Succeeded sets the job status succeeded.

func (*JobWrapper) Suspend

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

Suspend sets suspend in the job spec.

func (*JobWrapper) Tolerations added in v0.3.0

func (j *JobWrapper) Tolerations(t []corev1.Toleration) *JobWrapper

Tolerations set the tolerations.

type PodWrapper added in v0.6.0

type PodWrapper struct {
	corev1.Pod
}

PodWrapper wraps a Pod.

func MakePod added in v0.6.0

func MakePod(podName, ns string) *PodWrapper

MakePod creates a wrapper for a Pod.

func (*PodWrapper) AddAnnotation added in v0.6.0

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

AddAnnotation add a pod annotation.

func (*PodWrapper) AddLabel added in v0.6.0

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

AddLabel add a pod label.

func (*PodWrapper) Annotations added in v0.6.0

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

Annotations sets the pod annotations.

func (*PodWrapper) Labels added in v0.6.0

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

Labels sets the pod labels.

func (*PodWrapper) NodeSelector added in v0.6.0

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

NodeSelector sets the value of the pod.spec.nodeSelector.

func (*PodWrapper) Obj added in v0.6.0

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

Obj returns the wrapped Pod.

func (*PodWrapper) SetConditions added in v0.6.0

func (p *PodWrapper) SetConditions(conditions []corev1.PodCondition) *PodWrapper

SetConditions sets the value of the pod.status.conditions.

type ReplicatedJobWrapper

type ReplicatedJobWrapper struct {
	jobset.ReplicatedJob
}

ReplicatedJobWrapper wraps a ReplicatedJob.

func MakeReplicatedJob

func MakeReplicatedJob(name string) *ReplicatedJobWrapper

MakeReplicatedJob creates a wrapper for a ReplicatedJob.

func (*ReplicatedJobWrapper) Job

Job sets the Job spec for the ReplicatedJob template.

func (*ReplicatedJobWrapper) Obj

Obj returns the inner ReplicatedJob.

func (*ReplicatedJobWrapper) Replicas

Replicas sets the value of the ReplicatedJob.Replicas.

func (*ReplicatedJobWrapper) Subdomain added in v0.2.0

func (r *ReplicatedJobWrapper) Subdomain(subdomain string) *ReplicatedJobWrapper

Subdomain sets the subdomain on the PodSpec We artificially do this because the webhook does not work in testing

Jump to

Keyboard shortcuts

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