job

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreAllJobsCompleted

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

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

func WaitOnReady

func WaitOnReady(jobPrefix, namespace string, sleep, duration time.Duration) (bool, error)

WaitOnReady is used when you dont have a handle on a job but want to wait until its in a Succeeded state.

Types

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) (*Job, error)

CreateJobFromFile will create a Job from file with a name

func Get

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

Get will return a job with a given name and namespace

func (*Job) Delete

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

Delete will delete a Job in a given namespace

func (*Job) WaitOnReady

func (j *Job) WaitOnReady(sleep, duration time.Duration) (bool, error)

WaitOnReady will call the static method WaitOnReady 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