testing

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 5 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) EnableDNSHostnames added in v0.2.0

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

EnableDNSHostnames sets the value of ReplicatedJob.Network.EnableDNSHostnames.

func (*JobSetWrapper) FailurePolicy

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

FailurePolicy sets the value of jobSet.spec.failurePolicy

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) 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) 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

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) PodSpec

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

Containers sets the pod template spec containers.

type JobWrapper

type JobWrapper struct {
	batchv1.Job
}

JobWrapper wraps a Job.

func MakeJob

func MakeJob(jobName, ns string) *JobWrapper

MakeJobWrapper 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 sets the Job annotations.

func (*JobWrapper) JobLabels

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

JobLabels sets the Job labels.

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 sets the pod template spec annotations.

func (*JobWrapper) PodLabels

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

PodLabels sets the pod template spec labels.

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.

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

func (r *ReplicatedJobWrapper) Replicas(val int) *ReplicatedJobWrapper

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