package
Version:
v0.36.2
Opens a new window with list of versions in this module.
Published: May 24, 2019
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
func AreAllJobsCompleted(jobPrefix, namespace string) (bool, error)
-
func WaitOnDeleted(jobPrefix, namespace string, sleep, duration time.Duration) (bool, error)
-
func WaitOnReady(jobPrefix, namespace string, sleep, duration time.Duration) (bool, error)
-
type Job
-
func CreateJobFromFile(filename, name, namespace string) (*Job, error)
-
func CreateJobFromFileDeleteIfExists(filename, name, namespace string) (*Job, error)
-
func Get(jobName, namespace string) (*Job, error)
-
func GetAllByPrefix(prefix, namespace string) ([]Job, error)
-
type List
-
type Spec
-
type Status
AreAllJobsCompleted will return true if all jobs with a common prefix in a given namespace are in a Completed State
WaitOnDeleted returns when a job is successfully deleted
WaitOnReady is used when you dont have a handle on a job but want to wait until its in a Succeeded state.
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(filename, name, namespace string) (*Job, error)
CreateJobFromFile will create a Job from file with a name
func CreateJobFromFileDeleteIfExists(filename, name, namespace string) (*Job, error)
CreateJobFromFileDeleteIfExists will create a Job from file, deleting any pre-existing job with the same name
Get will return a job with a given name and namespace
GetAllByPrefix will return all jobs in a given namespace that match a prefix
Delete will delete a Job in a given namespace
WaitOnReady will call the static method WaitOnReady passing in p.Metadata.Name and p.Metadata.Namespace
type List struct {
Jobs []Job `json:"items"`
}
List is a container that holds all jobs returned from doing a kubectl get jobs
GetAll will return all jobs in a given namespace
type Spec struct {
Completions int `json:"completions"`
Parallelism int `json:"parallelism"`
}
Spec holds job spec metadata
type Status struct {
Active int `json:"active"`
Succeeded int `json:"succeeded"`
}
Status holds job status information
Source Files
¶
Click to show internal directories.
Click to hide internal directories.