job

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 13 Imported by: 19

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 deletes the batchv1.Job if exists. It is not an error to call this on an already deleted job.

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 the job hash changes while the previous job still running then the first it waits for the previous job to finish then deletes the old job and runs the new one. (We do this as we assume that killing a job can leave the openstack deployment in an incosistent state.) 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