jobrunner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	// TemplateRef references a Kubernetes object that contains the job template spec.
	TemplateRef JobTemplateRef `json:"templateRef"`

	// BackoffLimit specifies the number of retries before marking this job failed.
	BackoffLimit int32 `json:"backoffLimit"`

	// Timeout specifies the duration relative to the startTime that the job may be active
	// before the system tries to terminate it.
	// +optional
	Timeout time.Duration `json:"timeout,omitempty"`

	// Command specifies the job container command wrapped in a shell.
	// +optional
	Command string `json:"command,omitempty"`

	// CommandShell specifies the linux shell that executes the command; defaults to sh.
	// +optional
	CommandShell string `json:"commandShell,omitempty"`
}

type JobController

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

func NewJobController

func NewJobController(client *kubernetes.Clientset, namespace string, stopChan <-chan struct{}) (*JobController, error)

NewJobController starts Kubernetes informers for the specified namespace and returns a job controller.

func (*JobController) Run

func (ctrl *JobController) Run(ctx context.Context, task Job, cleanup bool) (*JobResult, error)

type JobResult

type JobResult struct {
	// Name of the Kubernetes job.
	Name string `json:"name"`

	// Namespace of the Kubernetes job.
	Namespace string `json:"namespace"`

	// Status describes the completion state of the job.
	// +optional
	Status *JobStatus `json:"status,omitempty"`

	// Output holds the Kubernetes pod logs collected after job completion.
	// +optional
	Output string `json:"output,omitempty"`
}

JobResult describes the result of a Kubernetes job execution.

type JobStatus

type JobStatus struct {
	// Failed means the job has failed its execution.
	Failed bool `json:"failed"`

	// Message is a human readable message indicating details about the job execution result.
	Message string `json:"message"`
}

JobStatus describes the completion state of a Kubernetes job.

type JobTemplateRef

type JobTemplateRef struct {
	// Name of the Kubernetes object.
	Name string `json:"name"`

	// Namespace of the Kubernetes object.
	Namespace string `json:"namespace"`
}

JobTemplateRef holds the reference to a Kubernetes object.

Jump to

Keyboard shortcuts

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