Documentation
¶
Index ¶
- Variables
- func ConcurrentTasks(tasks []jobtasks.Task, fn func(task jobtasks.Task) error) error
- func FilterTaskRefs(taskRefs []execution.TaskRef, filter TaskRefFilter) []execution.TaskRef
- func FindTaskRef(rj *execution.Job, task tasks.Task) *execution.TaskRef
- func GenerateTaskName(name string, index tasks.TaskIndex) (string, error)
- func GenerateTaskRefs(existing []execution.TaskRef, tasks []tasks.Task) []execution.TaskRef
- func GetAdmissionErrorMessage(rj *execution.Job) (string, bool)
- func GetCondition(rj *execution.Job) (execution.JobCondition, error)
- func GetForceDeleteTimeout(cfg *configv1alpha1.JobExecutionConfig) time.Duration
- func GetPendingTimeout(rj *execution.Job, cfg *configv1alpha1.JobExecutionConfig) time.Duration
- func GetPhase(rj *v1alpha1.Job) v1alpha1.JobPhase
- func GetResultPtr(result v1alpha1.JobResult) *v1alpha1.JobResult
- func GetTTLAfterFinished(rj *execution.Job, cfg *configv1alpha1.JobExecutionConfig) time.Duration
- func GetTaskRef(existing *execution.TaskRef, task tasks.Task) execution.TaskRef
- func IsActive(rj *execution.Job) bool
- func IsQueued(rj *execution.Job) bool
- func IsStarted(rj *execution.Job) bool
- func MarkAdmissionError(rj *execution.Job, msg string)
- func SortTaskRefs(taskRefs []execution.TaskRef)
- func UpdateJobTaskRefs(rj *execution.Job, tasks []tasks.Task) *execution.Job
- func UpdateTaskRefDeletedStatusIfNotSet(rj *execution.Job, taskName string, status execution.TaskStatus) *execution.Job
- type TaskRefFilter
Constants ¶
This section is empty.
Variables ¶
var ( // LabelKeyAdmissionErrorMessage stores any user error encountered when creating // tasks. This usually implies a misconfiguration that we cannot retry further, // hence the Job should transit into a terminal state. LabelKeyAdmissionErrorMessage = executiongroup.AddGroupToLabel("admission-error") )
Functions ¶
func ConcurrentTasks ¶
ConcurrentTasks provides a utility method to perform a method on all given Tasks concurrently.
func FilterTaskRefs ¶ added in v0.2.0
func FilterTaskRefs(taskRefs []execution.TaskRef, filter TaskRefFilter) []execution.TaskRef
FilterTaskRefs will filter the given TaskRefs according to the TaskRefFilter.
func FindTaskRef ¶
FindTaskRef returns the Task that matches the given Task's name.
func GenerateTaskName ¶ added in v0.2.0
GenerateTaskName generates a deterministic task name given a TaskIndex.
func GenerateTaskRefs ¶
GenerateTaskRefs reconciles tasks into an existing list of TaskRefs. If any task is no longer present, it will transition to TaskDeletedFinalStateUnknown.
func GetAdmissionErrorMessage ¶
GetAdmissionErrorMessage returns the error message if the Job contains the AdmissionErrorMessage annotation.
func GetCondition ¶
func GetCondition(rj *execution.Job) (execution.JobCondition, error)
GetCondition returns a consolidated JobCondition computed from TaskRefs. nolint: gocognit
func GetForceDeleteTimeout ¶ added in v0.2.0
func GetForceDeleteTimeout(cfg *configv1alpha1.JobExecutionConfig) time.Duration
GetForceDeleteTimeout returns the timeout before the controller starts force deletion.
func GetPendingTimeout ¶
func GetPendingTimeout(rj *execution.Job, cfg *configv1alpha1.JobExecutionConfig) time.Duration
GetPendingTimeout returns the pending timeout for the given Job.
func GetPhase ¶
GetPhase returns the phase of a Job based on the tasks and Job status so far. It expects that the JobCondition is up-to-date.
func GetResultPtr ¶
GetResultPtr converts a JobResult to a *JobResult.
func GetTTLAfterFinished ¶
func GetTTLAfterFinished(rj *execution.Job, cfg *configv1alpha1.JobExecutionConfig) time.Duration
GetTTLAfterFinished returns the TTL after a Job is finished.
func GetTaskRef ¶
GetTaskRef returns the TaskRef given a Task.
func IsActive ¶
IsActive returns true if the Job is considered active. An active job is one that is started and not terminal.
func IsQueued ¶
IsQueued returns true if the Job is queued. A queued job is one that is not started and not terminal.
func MarkAdmissionError ¶
MarkAdmissionError updates a Job to add the AdmissionError annotation.
func SortTaskRefs ¶
SortTaskRefs will sort the given TaskRefs by CreationTimestamp in ascending order.
func UpdateJobTaskRefs ¶
UpdateJobTaskRefs will update the TaskRefs in the Job's status given a list of tasks. Will return a new copy of the Job whose fields are updated.
func UpdateTaskRefDeletedStatusIfNotSet ¶
func UpdateTaskRefDeletedStatusIfNotSet( rj *execution.Job, taskName string, status execution.TaskStatus, ) *execution.Job
UpdateTaskRefDeletedStatusIfNotSet updates the DeletedStatus for a named Task if not already set.