job

package
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreAllJobsSucceeded added in v0.41.0

func AreAllJobsSucceeded(jobPrefix, namespace string) (bool, error)

AreAllJobsSucceeded will return true if all jobs with a common prefix in a given namespace are in a Completed State

func DescribeJobs added in v0.41.0

func DescribeJobs(jobPrefix, namespace string)

DescribeJobs describes all jobs whose name matches a substring

func WaitOnDeleted added in v0.36.0

func WaitOnDeleted(jobPrefix, namespace string, sleep, timeout time.Duration) (bool, error)

WaitOnDeleted returns when all jobs matching a prefix substring are successfully deleted

func WaitOnSucceeded added in v0.41.0

func WaitOnSucceeded(jobPrefix, namespace string, sleep, timeout time.Duration) (bool, error)

WaitOnSucceeded returns true if all jobs matching a prefix substring are in a succeeded state within a period of time

Types

type AreAllJobsSucceededResult added in v0.41.0

type AreAllJobsSucceededResult struct {
	// contains filtered or unexported fields
}

AreAllJobsSucceededResult is a return struct for AreAllJobsSucceededAsync

func AreAllJobsSucceededAsync added in v0.41.0

func AreAllJobsSucceededAsync(jobPrefix, namespace string) AreAllJobsSucceededResult

AreAllJobsSucceededAsync wraps AreAllJobsSucceeded with a struct response for goroutine + channel usage

type GetAllByPrefixResult added in v0.41.0

type GetAllByPrefixResult struct {
	// contains filtered or unexported fields
}

GetAllByPrefixResult is a return struct for GetAllByPrefixAsync

func GetAllByPrefixAsync added in v0.41.0

func GetAllByPrefixAsync(prefix, namespace string) GetAllByPrefixResult

GetAllByPrefixAsync wraps GetAllByPrefix with a struct response for goroutine + channel usage

type GetResult added in v0.42.0

type GetResult struct {
	Job *Job
	Err error
}

GetResult is a return struct for GetAsync

func GetAsync added in v0.42.0

func GetAsync(jobName, namespace string) GetResult

GetAsync wraps Get with a struct response for goroutine + channel usage

type Job

type Job struct {
	Metadata pod.Metadata `json:"metadata"`
	Spec     Spec         `json:"spec"`
	Status   Status       `json:"status"`
}

Job is used to parse data from kubectl get jobs

func CreateJobFromFile

func CreateJobFromFile(filename, name, namespace string, sleep, timeout time.Duration) (*Job, error)

CreateJobFromFile will create a Job from file with a name

func CreateJobFromFileDeleteIfExists added in v0.36.0

func CreateJobFromFileDeleteIfExists(filename, name, namespace string, sleep, timeout time.Duration) (*Job, error)

CreateJobFromFileDeleteIfExists will create a Job from file, deleting any pre-existing job with the same name

func CreateWindowsJobFromTemplate added in v0.38.0

func CreateWindowsJobFromTemplate(filename, name, namespace string, windowsTestImages *engine.WindowsTestImages, sleep, timeout time.Duration) (*Job, error)

CreateWindowsJobFromTemplate will create a Job from file with a name

func CreateWindowsJobFromTemplateDeleteIfExists added in v0.38.0

func CreateWindowsJobFromTemplateDeleteIfExists(filename, name, namespace string, windowsTestImages *engine.WindowsTestImages, sleep, timeout time.Duration) (*Job, error)

CreateWindowsJobFromTemplateDeleteIfExists will create a Job from file, deleting any pre-existing job with the same name

func Get

func Get(jobName, namespace string) (*Job, error)

Get will return a job with a given name and namespace

func GetAllByPrefix added in v0.36.0

func GetAllByPrefix(prefix, namespace string) ([]Job, error)

GetAllByPrefix will return all jobs in a given namespace that match a prefix

func GetWithRetry added in v0.42.0

func GetWithRetry(jobName, namespace string, sleep, timeout time.Duration) (*Job, error)

GetWithRetry gets a job, allowing for retries

func (*Job) Delete

func (j *Job) Delete(retries int) error

Delete will delete a Job in a given namespace

func (*Job) Describe added in v0.41.0

func (j *Job) Describe() error

Describe will describe a Job resource

func (*Job) WaitOnSucceeded added in v0.41.0

func (j *Job) WaitOnSucceeded(sleep, timeout time.Duration) (bool, error)

WaitOnSucceeded will call the static method WaitOnSucceeded passing in p.Metadata.Name and p.Metadata.Namespace

type List

type List struct {
	Jobs []Job `json:"items"`
}

List is a container that holds all jobs returned from doing a kubectl get jobs

func GetAll

func GetAll(namespace string) (*List, error)

GetAll will return all jobs in a given namespace

type Spec

type Spec struct {
	Completions int `json:"completions"`
	Parallelism int `json:"parallelism"`
}

Spec holds job spec metadata

type Status

type Status struct {
	Active    int `json:"active"`
	Succeeded int `json:"succeeded"`
}

Status holds job status information

Jump to

Keyboard shortcuts

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