job

package
v0.0.0-...-23d2596 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteJob

func DeleteJob(
	ctx context.Context,
	h *helper.Helper,
	name string,
	namespace string,
) error

DeleteJob func kclient required to properly cleanup the job depending pods with DeleteOptions

func GetJobWithName

func GetJobWithName(
	ctx context.Context,
	h *helper.Helper,
	name string,
	namespace string,
) (*batchv1.Job, error)

GetJobWithName func

Types

type Job

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

Job -

func NewJob

func NewJob(
	job *batchv1.Job,
	jobType string,
	preserve bool,
	timeout time.Duration,
	beforeHash string,
) *Job

NewJob returns an initialized Job.

func (*Job) DoJob

func (j *Job) DoJob(
	ctx context.Context,
	h *helper.Helper,
) (ctrl.Result, error)

DoJob - run a job if the hashBefore and hash is different. If there is an existing job, wait for the job to finish. Right now we do not expect the job to change while running. If TTLSecondsAfterFinished is unset on the Job and preserve is false, the Job will be deleted after 10 minutes. Set preserve to true if you want to keep the job, or set a specific value to job.Spec.TTLSecondsAfterFinished to define when the Job should be deleted.

func (*Job) GetHash

func (j *Job) GetHash() string

GetHash func

func (*Job) HasChanged

func (j *Job) HasChanged() bool

HasChanged func

Jump to

Keyboard shortcuts

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