v1alpha1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the execution v1alpha1 API group +kubebuilder:object:generate=true +groupName=execution.furiko.io

Index

Constants

View Source
const (
	Version = "v1alpha1"

	KindJob       = "Job"
	KindJobConfig = "JobConfig"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: execution.GroupName, Version: Version}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	GVKJob       = SchemeGroupVersion.WithKind(KindJob)
	GVKJobConfig = SchemeGroupVersion.WithKind(KindJobConfig)
)

Declare schema.GroupVersionKind for each Kind in this Group.

View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   execution.GroupName,
	Version: Version,
}

SchemeGroupVersion is group version used to register these objects.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Types

type BoolOptionConfig

type BoolOptionConfig struct {
	// Default value, will be used to populate the option if not specified.
	Default bool `json:"default"`

	// Determines how to format the value as string.
	// Can be one of: TrueFalse, OneZero, YesNo, Custom
	//
	// Default: TrueFalse
	// +optional
	Format BoolOptionFormat `json:"format,omitempty"`

	// If Format is custom, will be substituted if value is true.
	// Can also be an empty string.
	//
	// +optional
	TrueVal string `json:"trueVal,omitempty"`

	// If Format is custom, will be substituted if value is false.
	// Can also be an empty string.
	//
	// +optional
	FalseVal string `json:"falseVal,omitempty"`
}

BoolOptionConfig defines the options for OptionTypeBool.

func (*BoolOptionConfig) DeepCopy

func (in *BoolOptionConfig) DeepCopy() *BoolOptionConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BoolOptionConfig.

func (*BoolOptionConfig) DeepCopyInto

func (in *BoolOptionConfig) DeepCopyInto(out *BoolOptionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BoolOptionConfig) FormatValue

func (c *BoolOptionConfig) FormatValue(value bool) (string, error)

type BoolOptionFormat

type BoolOptionFormat string

BoolOptionFormat describes how a bool option should be formatted.

const (
	// BoolOptionFormatTrueFalse formats bool values as "true" and "false"
	// respectively.
	BoolOptionFormatTrueFalse BoolOptionFormat = "TrueFalse"

	// BoolOptionFormatOneZero formats bool values as "1" and "0" respectively.
	BoolOptionFormatOneZero BoolOptionFormat = "OneZero"

	// BoolOptionFormatYesNo formats bool values as "yes" and "no" respectively.
	BoolOptionFormatYesNo BoolOptionFormat = "YesNo"

	// BoolOptionFormatCustom formats bool values according to a custom format.
	BoolOptionFormatCustom BoolOptionFormat = "Custom"
)

func (BoolOptionFormat) Format

func (b BoolOptionFormat) Format(val bool) (string, error)

func (BoolOptionFormat) IsValid

func (b BoolOptionFormat) IsValid() bool

type ConcurrencyPolicy

type ConcurrencyPolicy string
const (
	// ConcurrencyPolicyAllow allows multiple Job objects for a single JobConfig to
	// be created concurrently.
	ConcurrencyPolicyAllow ConcurrencyPolicy = "Allow"

	// ConcurrencyPolicyForbid forbids multiple Job objects for a single JobConfig
	// to be created concurrently. If a new Job is set to be automatically scheduled
	// with another concurrent Job, the new Job will be dropped from the queue.
	ConcurrencyPolicyForbid ConcurrencyPolicy = "Forbid"

	// ConcurrencyPolicyEnqueue enqueues the Job to be run after other Jobs for the
	// JobConfig have finished. If a new Job is set to be automatically scheduld
	// with another concurrent Job, the new Job will wait until the previous Job
	// finishes.
	ConcurrencyPolicyEnqueue ConcurrencyPolicy = "Enqueue"
)

type ConcurrencySpec

type ConcurrencySpec struct {
	// Policy describes how to treat concurrent executions of the same JobConfig.
	Policy ConcurrencyPolicy `json:"policy"`

	// Maximum number of Jobs that can be running concurrently for the same
	// JobConfig. Cannot be specified if Policy is set to Allow.
	//
	// Defaults to 1.
	//
	// +optional
	MaxConcurrency *int64 `json:"maxConcurrency,omitempty"`
}

ConcurrencySpec defines how to handle multiple concurrent Jobs for the JobConfig.

func (*ConcurrencySpec) DeepCopy

func (in *ConcurrencySpec) DeepCopy() *ConcurrencySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConcurrencySpec.

func (*ConcurrencySpec) DeepCopyInto

func (in *ConcurrencySpec) DeepCopyInto(out *ConcurrencySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ConcurrencySpec) GetMaxConcurrency added in v0.2.1

func (c ConcurrencySpec) GetMaxConcurrency() int64

GetMaxConcurrency returns the MaxConcurrency value if specified, otherwise defaults to 1.

type CronSchedule

type CronSchedule struct {
	// Cron expression to specify how the JobConfig will be periodically scheduled.
	// Example: "0 0/5 * * *".
	//
	// Supports cron schedules with optional "seconds" and "years" fields, i.e. can
	// parse between 5 to 7 tokens.
	//
	// More information: https://github.com/furiko-io/cronexpr
	Expression string `json:"expression"`

	// Timezone to interpret the cron schedule in. For example, a cron schedule of
	// "0 10 * * *" with a timezone of "Asia/Singapore" will be interpreted as
	// running at 02:00:00 UTC time every day.
	//
	// Timezone must be one of the following:
	//
	//  1. A valid tz string (e.g. "Asia/Singapore", "America/New_York").
	//  2. A UTC offset with minutes (e.g. UTC-10:00).
	//  3. A GMT offset with minutes (e.g. GMT+05:30). The meaning is the
	//     same as its UTC counterpart.
	//
	// This field merely is used for parsing the cron Expression, and has nothing to
	// do with /etc/timezone inside the container (i.e. it will not set $TZ
	// automatically).
	//
	// Defaults to the controller's default configured timezone.
	//
	// +optional
	Timezone string `json:"timezone,omitempty"`
}

CronSchedule defines a Schedule based on cron format.

func (*CronSchedule) DeepCopy

func (in *CronSchedule) DeepCopy() *CronSchedule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CronSchedule.

func (*CronSchedule) DeepCopyInto

func (in *CronSchedule) DeepCopyInto(out *CronSchedule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DateOptionConfig

type DateOptionConfig struct {
	// Date format in moment.js format. If not specified, will use RFC3339 format by
	// default.
	//
	// Date format reference: https://momentjs.com/docs/#/displaying/format/
	//
	// Default:
	// +optional
	Format string `json:"format,omitempty"`
}

DateOptionConfig defines the options for OptionTypeDate.

func (*DateOptionConfig) DeepCopy

func (in *DateOptionConfig) DeepCopy() *DateOptionConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DateOptionConfig.

func (*DateOptionConfig) DeepCopyInto

func (in *DateOptionConfig) DeepCopyInto(out *DateOptionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IndexState added in v0.2.0

type IndexState string
const (
	// IndexNotCreated means that no tasks have been created for the index.
	IndexNotCreated IndexState = "NotCreated"

	// IndexRetryBackoff means that the index is currently in retry backoff.
	IndexRetryBackoff IndexState = "RetryBackoff"

	// IndexStarting means that the current task in the index has not yet started running.
	IndexStarting IndexState = "Starting"

	// IndexRunning means that the current task in the index is currently running.
	IndexRunning IndexState = "Running"

	// IndexTerminated means that all tasks in the index is terminated.
	IndexTerminated IndexState = "Terminated"
)

type Job

type Job struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   JobSpec   `json:"spec,omitempty"`
	Status JobStatus `json:"status,omitempty"`
}

Job is the schema for a single job execution, which may consist of multiple tasks.

func (*Job) DeepCopy

func (in *Job) DeepCopy() *Job

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Job.

func (*Job) DeepCopyInto

func (in *Job) DeepCopyInto(out *Job)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Job) DeepCopyObject

func (in *Job) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Job) GetMaxAttempts added in v0.2.0

func (j *Job) GetMaxAttempts() int64

GetMaxAttempts returns the maximum attempts if specified in the template, otherwise defaults to 1.

func (*Job) GetRetryDelay added in v0.2.0

func (j *Job) GetRetryDelay() time.Duration

GetRetryDelay return the retry delay if specified in the template, otherwise defaults to 0.

type JobCondition

type JobCondition struct {
	// Stores the status of the Job's queueing condition. If specified, it means
	// that the Job is currently not started and is queued.
	//
	// +optional
	Queueing *JobConditionQueueing `json:"queueing,omitempty"`

	// Stores the status of the Job's waiting condition. If specified, it means that
	// the Job currently is waiting for at least one task to be created and start
	// running.
	//
	// +optional
	Waiting *JobConditionWaiting `json:"waiting,omitempty"`

	// Stores the status of the Job's running state. If specified, it means that all
	// tasks in the Job have started running. If the Job is already complete, this
	// status may be set of not all tasks are terminated.
	//
	// +optional
	Running *JobConditionRunning `json:"running,omitempty"`

	// Stores the status of the Job's finished state. If specified, it means that
	// all tasks in the Job have terminated.
	//
	// +optional
	Finished *JobConditionFinished `json:"finished,omitempty"`
}

JobCondition holds a possible condition of a Job. Only one of its members may be specified. If none of them is specified, the default one is JobConditionQueueing.

func (*JobCondition) DeepCopy

func (in *JobCondition) DeepCopy() *JobCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobCondition.

func (*JobCondition) DeepCopyInto

func (in *JobCondition) DeepCopyInto(out *JobCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConditionFinished

type JobConditionFinished struct {
	// The time at which the latest task was created by the controller. May be nil
	// if no tasks were ever created.
	//
	// +optional
	LatestCreationTimestamp *metav1.Time `json:"latestCreationTimestamp,omitempty"`

	// The time at which the latest task had started running. May be nil if no tasks
	// had started running.
	//
	// +optional
	LatestRunningTimestamp *metav1.Time `json:"latestRunningTimestamp,omitempty"`

	// The time at which the Job was first marked as finished by the controller.
	FinishTimestamp metav1.Time `json:"finishTime"`

	// The result of it being finished.
	Result JobResult `json:"result"`

	// Unique, one-word, CamelCase reason for the condition's last transition.
	//
	// +optional
	Reason string `json:"reason,omitempty"`

	// Optional descriptive message explaining the condition's last transition.
	//
	// +optional
	Message string `json:"message,omitempty"`
}

JobConditionFinished stores the status of the final finished result of a Job.

func (*JobConditionFinished) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConditionFinished.

func (*JobConditionFinished) DeepCopyInto

func (in *JobConditionFinished) DeepCopyInto(out *JobConditionFinished)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConditionQueueing

type JobConditionQueueing struct {
	// Unique, one-word, CamelCase reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Optional descriptive message explaining the condition's last transition.
	// +optional
	Message string `json:"message,omitempty"`
}

JobConditionQueueing stores the status of a Job currently in the queue.

func (*JobConditionQueueing) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConditionQueueing.

func (*JobConditionQueueing) DeepCopyInto

func (in *JobConditionQueueing) DeepCopyInto(out *JobConditionQueueing)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConditionRunning

type JobConditionRunning struct {
	// The timestamp for the latest task that was created by the controller.
	LatestCreationTimestamp metav1.Time `json:"latestTaskCreationTimestamp"`

	// The time at which the latest task had started running.
	LatestRunningTimestamp metav1.Time `json:"latestRunningTimestamp"`

	// Number of tasks waiting to be terminated.
	TerminatingTasks int64 `json:"terminatingTasks,omitempty"`
}

JobConditionRunning stores the status of a currently running Job.

func (*JobConditionRunning) DeepCopy

func (in *JobConditionRunning) DeepCopy() *JobConditionRunning

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConditionRunning.

func (*JobConditionRunning) DeepCopyInto

func (in *JobConditionRunning) DeepCopyInto(out *JobConditionRunning)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConditionWaiting

type JobConditionWaiting struct {
	// Unique, one-word, CamelCase reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Optional descriptive message explaining the condition's last transition.
	// +optional
	Message string `json:"message,omitempty"`
}

JobConditionWaiting stores the status of a currently waiting Job.

func (*JobConditionWaiting) DeepCopy

func (in *JobConditionWaiting) DeepCopy() *JobConditionWaiting

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConditionWaiting.

func (*JobConditionWaiting) DeepCopyInto

func (in *JobConditionWaiting) DeepCopyInto(out *JobConditionWaiting)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConfig

type JobConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   JobConfigSpec   `json:"spec,omitempty"`
	Status JobConfigStatus `json:"status,omitempty"`
}

JobConfig is the schema for a single job configuration. Multiple Job objects belong to a single JobConfig.

func (*JobConfig) DeepCopy

func (in *JobConfig) DeepCopy() *JobConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfig.

func (*JobConfig) DeepCopyInto

func (in *JobConfig) DeepCopyInto(out *JobConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*JobConfig) DeepCopyObject

func (in *JobConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type JobConfigList

type JobConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []JobConfig `json:"items"`
}

JobConfigList contains a list of JobConfig objects.

func (*JobConfigList) DeepCopy

func (in *JobConfigList) DeepCopy() *JobConfigList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigList.

func (*JobConfigList) DeepCopyInto

func (in *JobConfigList) DeepCopyInto(out *JobConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*JobConfigList) DeepCopyObject

func (in *JobConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type JobConfigSpec

type JobConfigSpec struct {
	// Template for creating the Job.
	Template JobTemplateSpec `json:"template"`

	// Concurrency defines the behaviour of multiple concurrent Jobs.
	Concurrency ConcurrencySpec `json:"concurrency"`

	// Schedule is an optional field that defines automatic scheduling of the
	// JobConfig.
	//
	// +optional
	Schedule *ScheduleSpec `json:"schedule,omitempty"`

	// Option is an optional field that defines how the JobConfig is parameterized.
	// Each option defined here can subsequently be used in the Template via context
	// variable substitution.
	//
	// +optional
	Option *OptionSpec `json:"option,omitempty"`
}

JobConfigSpec defines the desired state of the JobConfig.

func (*JobConfigSpec) DeepCopy

func (in *JobConfigSpec) DeepCopy() *JobConfigSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigSpec.

func (*JobConfigSpec) DeepCopyInto

func (in *JobConfigSpec) DeepCopyInto(out *JobConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobConfigState

type JobConfigState string
const (
	// JobConfigReady means that the JobConfig is ready to be executed. This state
	// is used if the JobConfig has no schedule set, otherwise a more specific state
	// like ReadyDisabled or ReadyEnabled is preferred.
	JobConfigReady JobConfigState = "Ready"

	// JobConfigReadyEnabled means that the JobConfig has a schedule specified
	// which is enabled, and is ready to be executed.
	JobConfigReadyEnabled JobConfigState = "ReadyEnabled"

	// JobConfigReadyDisabled means that the JobConfig has a schedule specified
	// which is disabled, and is ready to be executed.
	JobConfigReadyDisabled JobConfigState = "ReadyDisabled"

	// JobConfigJobQueued means that the JobConfig has some Job(s) that are Queued,
	// and none of them are started yet.
	JobConfigJobQueued JobConfigState = "JobQueued"

	// JobConfigExecuting means that the JobConfig has some Job already started and
	// may be running.
	JobConfigExecuting JobConfigState = "Executing"
)

type JobConfigStatus

type JobConfigStatus struct {
	// Human-readable and high-level representation of the status of the JobConfig.
	State JobConfigState `json:"state"`

	// Total number of Jobs queued for the JobConfig. A job that is queued is one
	// that is not yet started.
	//
	// +optional
	Queued int64 `json:"queued"`

	// A list of pointers to Job objects queued for the JobConfig.
	//
	// +optional
	QueuedJobs []JobReference `json:"queuedJobs,omitempty"`

	// Total number of active jobs created for the JobConfig. An active job is one
	// that is waiting to create a task, waiting for a task to be running, or has a
	// running task.
	//
	// +optional
	Active int64 `json:"active"`

	// A list of pointers to active Job objects for the JobConfig.
	//
	// +optional
	ActiveJobs []JobReference `json:"activeJobs,omitempty"`

	// The last known schedule time for this job config, used to persist state
	// during controller downtime. If the controller was down for a short period of
	// time, any schedules that were missed during the downtime will be
	// back-scheduled, subject to the number of schedules missed since
	// LastScheduled.
	//
	// +optional
	LastScheduled *metav1.Time `json:"lastScheduled,omitempty"`
}

JobConfigStatus defines the observed state of the JobConfig.

func (*JobConfigStatus) DeepCopy

func (in *JobConfigStatus) DeepCopy() *JobConfigStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobConfigStatus.

func (*JobConfigStatus) DeepCopyInto

func (in *JobConfigStatus) DeepCopyInto(out *JobConfigStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobList

type JobList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Job `json:"items"`
}

JobList contains a list of Job

func (*JobList) DeepCopy

func (in *JobList) DeepCopy() *JobList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobList.

func (*JobList) DeepCopyInto

func (in *JobList) DeepCopyInto(out *JobList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*JobList) DeepCopyObject

func (in *JobList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type JobPhase

type JobPhase string
const (
	// JobQueued means that the job is not yet started.
	JobQueued JobPhase = "Queued"

	// JobStarting means that the job is starting up, and no tasks have been created
	// yet.
	JobStarting JobPhase = "Starting"

	// JobAdmissionError means that the job could not start due to an admission
	// error that cannot be retried.
	JobAdmissionError JobPhase = "AdmissionError"

	// JobPending means that the job is started but not all tasks are running yet.
	JobPending JobPhase = "Pending"

	// JobRunning means that all tasks have started running, and it is not yet
	// finished.
	JobRunning JobPhase = "Running"

	// JobTerminating means that the job is completed, but not all tasks are
	// terminated yet.
	JobTerminating JobPhase = "Terminating"

	// JobRetryBackoff means that the job is backing off the next retry due to a
	// failed task. The job is currently waiting for its retry delay before creating
	// the next task.
	JobRetryBackoff JobPhase = "RetryBackoff"

	// JobRetrying means that the job had previously failed, and a new task has been
	// created to retry, but it has not yet started running.
	JobRetrying JobPhase = "Retrying"

	// JobSucceeded means that the job was completed successfully.
	JobSucceeded JobPhase = "Succeeded"

	// JobFailed means that the job did not complete successfully.
	JobFailed JobPhase = "Failed"

	// JobKilling means that the job and its tasks are in the process of being
	// killed and no more tasks will be created.
	JobKilling JobPhase = "Killing"

	// JobKilled means that the job and all its tasks are fully killed via external
	// interference, and tasks are guaranteed to have been stopped. No more tasks
	// will be created even if not all retry attempts are exhausted.
	JobKilled JobPhase = "Killed"

	// JobFinishedUnknown means that the job is finished but for some reason we do
	// not know its result.
	JobFinishedUnknown JobPhase = "FinishedUnknown"
)

func (JobPhase) IsTerminal

func (p JobPhase) IsTerminal() bool

IsTerminal returns true if the Job is considered terminal. A terminal phase means that the Job will no longer transition into a non-terminal phase after this.

type JobReference

type JobReference struct {
	// UID of the Job.
	UID types.UID `json:"uid"`

	// Name of the Job.
	Name string `json:"name"`

	// Timestamp that the Job was created.
	CreationTimestamp metav1.Time `json:"creationTimestamp"`

	// Phase of the Job.
	Phase JobPhase `json:"phase"`

	// Timestamp that the Job was started.
	// +optional
	StartTime *metav1.Time `json:"startTime,omitempty"`
}

func (*JobReference) DeepCopy

func (in *JobReference) DeepCopy() *JobReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobReference.

func (*JobReference) DeepCopyInto

func (in *JobReference) DeepCopyInto(out *JobReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobResult

type JobResult string
const (
	// JobResultSuccess means that the Job finished successfully.
	JobResultSuccess JobResult = "Success"

	// JobResultFailed means that the Job has failed and will no longer retry.
	JobResultFailed JobResult = "Failed"

	// JobResultAdmissionError means that the Job could not start due to an error
	// from trying to admit creation of tasks.
	JobResultAdmissionError JobResult = "AdmissionError"

	// JobResultKilled means that the Job and all of its tasks have been killed.
	JobResultKilled JobResult = "Killed"

	// JobResultFinalStateUnknown means that the final state of the job is unknown.
	JobResultFinalStateUnknown JobResult = "FinalStateUnknown"
)

func (JobResult) IsFailed

func (r JobResult) IsFailed() bool

type JobSpec

type JobSpec struct {
	// ConfigName allows specifying the name of the JobConfig to create the Job
	// from. The JobConfig must be in the same namespace as the Job.
	//
	// It is provided as a write-only input field for convenience, and will override
	// the template, labels and annotations from the JobConfig's template.
	//
	// This field will never be returned from the API. To look up the parent
	// JobConfig, use ownerReferences.
	//
	// +optional
	ConfigName string `json:"configName,omitempty"`

	// Specifies the type of Job.
	// Can be one of: Adhoc, Scheduled
	//
	// Default: Adhoc
	// +optional
	Type JobType `json:"type"`

	// Specifies optional start policy for a Job, which specifies certain conditions
	// which have to be met before a Job is started.
	//
	// +optional
	StartPolicy *StartPolicySpec `json:"startPolicy,omitempty"`

	// Template specifies how to create the Job.
	// +optional
	Template *JobTemplate `json:"template,omitempty"`

	// Specifies key-values pairs of values for Options, in JSON or YAML format.
	//
	// Example specification:
	//
	//   spec:
	//     optionValues: |-
	//       myStringOption: "value"
	//       myBoolOption: true
	//       mySelectOption:
	//       - option1
	//       - option3
	//
	// Each entry in the optionValues struct should consist of the option's name,
	// and the value could be an arbitrary type that corresponds to the option's
	// type itself. Each option value specified will be evaluated to a string based
	// on the JobConfig's OptionsSpec and added to Substitutions. If the key also
	// exists in Substitutions, that one takes priority.
	//
	// Cannot be updated after creation.
	//
	// +optional
	OptionValues string `json:"optionValues,omitempty"`

	// Defines key-value pairs of context variables to be substituted into the
	// TaskTemplate. Each entry should consist of the full context variable name
	// (i.e. `ctx.name`), and the values must be a string. Substitutions defined
	// here take highest precedence over both predefined context variables and
	// evaluated OptionValues.
	//
	// Most users should be using OptionValues to specify custom Job Option values
	// for running the Job instead of using Subsitutions directly.
	//
	// Cannot be updated after creation.
	//
	// +optional
	Substitutions map[string]string `json:"substitutions,omitempty"`

	// Specifies the time to start killing the job. When the time passes this
	// timestamp, the controller will start attempting to kill all tasks.
	//
	// +optional
	KillTimestamp *metav1.Time `json:"killTimestamp,omitempty"`

	// Specifies the maximum lifetime of a Job that is finished. If not set, it will
	// be set to the DefaultTTLSecondsAfterFinished configuration value in the
	// controller.
	//
	// +optional
	TTLSecondsAfterFinished *int64 `json:"ttlSecondsAfterFinished,omitempty"`
}

JobSpec defines the desired state of a Job.

func (*JobSpec) DeepCopy

func (in *JobSpec) DeepCopy() *JobSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSpec.

func (*JobSpec) DeepCopyInto

func (in *JobSpec) DeepCopyInto(out *JobSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobStatus

type JobStatus struct {
	// Phase stores the high-level description of a Job's state.
	Phase JobPhase `json:"phase"`

	// Condition stores details about the Job's current condition.
	Condition JobCondition `json:"condition"`

	// StartTime specifies the time that the Job was started by the controller. If
	// nil, it means that the Job is Queued. Cannot be changed once set.
	//
	// +optional
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// CreatedTasks describes how many tasks were created in total for this Job.
	CreatedTasks int64 `json:"createdTasks"`

	// RunningTasks describes how many tasks are currently running for this Job.
	RunningTasks int64 `json:"runningTasks"`

	// Tasks contains a list of tasks created by the controller. The controller
	// updates this field when it creates a task, which helps to guard against
	// recreating tasks after they were deleted, and also stores necessary task data
	// for reconciliation in case tasks are deleted.
	//
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=atomic
	Tasks []TaskRef `json:"tasks,omitempty"`

	// The current status for parallel execution of the job.
	// May not be set if the job is not a parallel job.
	//
	// +optional
	ParallelStatus *ParallelStatus `json:"parallelStatus,omitempty"`
}

JobStatus defines the observed state of a Job.

func (*JobStatus) DeepCopy

func (in *JobStatus) DeepCopy() *JobStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus.

func (*JobStatus) DeepCopyInto

func (in *JobStatus) DeepCopyInto(out *JobStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobTemplate

type JobTemplate struct {
	// Defines the template to create a single task in the Job.
	TaskTemplate TaskTemplate `json:"taskTemplate"`

	// Describes how to run multiple tasks in parallel for the Job. If not set, then
	// there will be at most a single task running at any time.
	//
	// +optional
	Parallelism *ParallelismSpec `json:"parallelism,omitempty"`

	// Specifies maximum number of attempts before the Job will terminate in
	// failure. If defined, the controller will wait retryDelaySeconds before
	// creating the next task. Once maxAttempts is reached, the Job terminates in
	// RetryLimitExceeded.
	//
	// If parallelism is also defined, this corresponds to the maximum attempts for
	// each parallel task. That is, if there are 5 parallel task to be run at a
	// time, with maxAttempts of 3, the Job may create up to a maximum of 15 tasks
	// if each has failed.
	//
	// Value must be a positive integer. Defaults to 1.
	//
	// +optional
	MaxAttempts *int64 `json:"maxAttempts,omitempty"`

	// Optional duration in seconds to wait between retries. If left empty or zero,
	// it means no delay (i.e. retry immediately).
	//
	// If parallelism is also defined, the retry delay is from the time of the last
	// failed task with the same index. That is, if there are two parallel tasks -
	// index 0 and index 1 - which failed at t=0 and t=15, with retryDelaySeconds of
	// 30, the controller will only create the next attempts at t=30 and t=45
	// respectively.
	//
	// Value must be a non-negative integer.
	//
	// +optional
	RetryDelaySeconds *int64 `json:"retryDelaySeconds,omitempty"`

	// Optional duration in seconds to wait before terminating the task if it is
	// still pending. This field is useful to prevent jobs from being stuck forever
	// if the Job has a deadline to start running by. If not set, it will be set to
	// the DefaultPendingTimeoutSeconds configuration value in the controller. To
	// disable pending timeout, set this to 0.
	//
	// +optional
	TaskPendingTimeoutSeconds *int64 `json:"taskPendingTimeoutSeconds,omitempty"`

	// Defines whether tasks are allowed to be force deleted or not. If the node is
	// unresponsive, it may be possible that the task cannot be killed by normal
	// graceful deletion. The controller may choose to force delete the task, which
	// would ignore the final state of the task since the node is unable to return
	// whether the task is actually still alive.
	//
	// If not set to true, there may be some cases when there may actually be two
	// concurrently running tasks when even when ConcurrencyPolicyForbid. Setting
	// this to true would prevent this from happening, but the Job may remain stuck
	// indefinitely until the node recovers.
	//
	// +optional
	ForbidTaskForceDeletion bool `json:"forbidTaskForceDeletion,omitempty"`
}

JobTemplate specifies how to create the Job.

func (*JobTemplate) DeepCopy

func (in *JobTemplate) DeepCopy() *JobTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobTemplate.

func (*JobTemplate) DeepCopyInto

func (in *JobTemplate) DeepCopyInto(out *JobTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobTemplateSpec

type JobTemplateSpec struct {
	// Standard object's metadata that will be added to Job. More info:
	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	//
	// +kubebuilder:validation:XPreserveUnknownFields
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the job.
	Spec JobTemplate `json:"spec"`
}

JobTemplateSpec specifies how to create a Job with metadata.

func (*JobTemplateSpec) DeepCopy

func (in *JobTemplateSpec) DeepCopy() *JobTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobTemplateSpec.

func (*JobTemplateSpec) DeepCopyInto

func (in *JobTemplateSpec) DeepCopyInto(out *JobTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobType

type JobType string
const (
	// JobTypeAdhoc means that the Job was created on an ad-hoc basis externally.
	JobTypeAdhoc JobType = "Adhoc"

	// JobTypeScheduled means that the Job was created on an automatic schedule.
	JobTypeScheduled JobType = "Scheduled"
)

type MultiOptionConfig

type MultiOptionConfig struct {
	// Default values, will be used to populate the option if not specified.
	// +optional
	Default []string `json:"default,omitempty"`

	// Delimiter to join values by.
	Delimiter string `json:"delimiter"`

	// List of values to be chosen from.
	Values []string `json:"values"`

	// Whether to allow custom values instead of just the list of allowed values.
	//
	// Default: false
	// +optional
	AllowCustom bool `json:"allowCustom,omitempty"`
}

MultiOptionConfig defines the options for OptionTypeMulti.

func (*MultiOptionConfig) DeepCopy

func (in *MultiOptionConfig) DeepCopy() *MultiOptionConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiOptionConfig.

func (*MultiOptionConfig) DeepCopyInto

func (in *MultiOptionConfig) DeepCopyInto(out *MultiOptionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Option

type Option struct {
	// The type of the job option.
	// Can be one of: bool, string, select, multi, date
	Type OptionType `json:"type"`

	// The name of the job option. Will be substituted as `${option.NAME}`.
	// Must match the following regex: ^[a-zA-Z_0-9.-]+$
	Name string `json:"name"`

	// Label is an optional human-readable label for this option, which is purely
	// used for display purposes.
	//
	// +optional
	Label string `json:"label,omitempty"`

	// Required defines whether this field is required.
	//
	// Default: false
	// +optional
	Required bool `json:"required,omitempty"`

	// Bool adds additional configuration for OptionTypeBool.
	// +optional
	Bool *BoolOptionConfig `json:"bool,omitempty"`

	// String adds additional configuration for OptionTypeString.
	// +optional
	String *StringOptionConfig `json:"string,omitempty"`

	// Select adds additional configuration for OptionTypeSelect.
	// +optional
	Select *SelectOptionConfig `json:"select,omitempty"`

	// Multi adds additional configuration for OptionTypeMulti.
	// +optional
	Multi *MultiOptionConfig `json:"multi,omitempty"`

	// Date adds additional configuration for OptionTypeDate.
	// +optional
	Date *DateOptionConfig `json:"date,omitempty"`
}

Option defines a single job option.

func (*Option) DeepCopy

func (in *Option) DeepCopy() *Option

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Option.

func (*Option) DeepCopyInto

func (in *Option) DeepCopyInto(out *Option)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OptionSpec

type OptionSpec struct {
	// Options is a list of job options.
	// +optional
	Options []Option `json:"options,omitempty"`
}

OptionSpec defines how a JobConfig is parameterized using Job Options.

func (*OptionSpec) DeepCopy

func (in *OptionSpec) DeepCopy() *OptionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OptionSpec.

func (*OptionSpec) DeepCopyInto

func (in *OptionSpec) DeepCopyInto(out *OptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OptionType

type OptionType string
const (
	// OptionTypeBool defines an Option whose type is a boolean value.
	OptionTypeBool OptionType = "Bool"

	// OptionTypeString defines an Option whose type is an arbitrary string.
	OptionTypeString OptionType = "String"

	// OptionTypeSelect defines an Option whose value comes from a list of strings.
	OptionTypeSelect OptionType = "Select"

	// OptionTypeMulti defines an Option that contains zero or more values from a
	// list of strings, delimited with some delimiter.
	OptionTypeMulti OptionType = "Multi"

	// OptionTypeDate defines an Option whose value is a formatted date string.
	OptionTypeDate OptionType = "Date"
)

func (OptionType) IsValid

func (t OptionType) IsValid() bool

type ParallelCompletionStrategy added in v0.2.0

type ParallelCompletionStrategy string

ParallelCompletionStrategy defines the condition when a Job is completed when there are multiple tasks running in parallel.

const (
	// AllSuccessful means that the Job will only stop once all parallel tasks have
	// completed successfully, or when any task index has exhausted all its retries
	// and immediately terminate all remaining tasks.
	AllSuccessful ParallelCompletionStrategy = "AllSuccessful"

	// AnySuccessful means that the Job will stop once any parallel task has
	// completed successfully and immediately terminate all remaining tasks.
	AnySuccessful ParallelCompletionStrategy = "AnySuccessful"
)

type ParallelIndex added in v0.2.0

type ParallelIndex struct {
	// If withCount is used for parallelism, contains the index number of the job
	// numbered from 0 to N-1.
	//
	// +optional
	IndexNumber *int64 `json:"indexNumber,omitempty"`

	// If withKeys is used for parallelism, contains the index key of the job as a
	// string.
	//
	// +optional
	IndexKey string `json:"indexKey,omitempty"`

	// If withMatrix is used for parallelism, contains key-value pairs of the job as
	// strings.
	//
	// +mapType=atomic
	// +optional
	MatrixValues map[string]string `json:"matrixValues,omitempty"`
}

ParallelIndex specifies the index for a single parallel task.

func (*ParallelIndex) DeepCopy added in v0.2.0

func (in *ParallelIndex) DeepCopy() *ParallelIndex

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParallelIndex.

func (*ParallelIndex) DeepCopyInto added in v0.2.0

func (in *ParallelIndex) DeepCopyInto(out *ParallelIndex)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParallelIndexStatus added in v0.2.0

type ParallelIndexStatus struct {
	// The parallel index.
	Index ParallelIndex `json:"index"`

	// Hash of the index.
	Hash string `json:"hash"`

	// Total number of tasks created for this parallel index.
	CreatedTasks int64 `json:"createdTasks"`

	// Overall state of the parallel index.
	State IndexState `json:"state"`

	// Result of executing tasks for this parallel index if it is already terminated.
	// +optional
	Result TaskResult `json:"result,omitempty"`
}

ParallelIndexStatus stores the status for a single ParallelIndex in the Job. There should be at most one task running at a time for a single parallel index in the Job.

func (*ParallelIndexStatus) DeepCopy added in v0.2.0

func (in *ParallelIndexStatus) DeepCopy() *ParallelIndexStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParallelIndexStatus.

func (*ParallelIndexStatus) DeepCopyInto added in v0.2.0

func (in *ParallelIndexStatus) DeepCopyInto(out *ParallelIndexStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParallelStatus added in v0.2.0

type ParallelStatus struct {
	ParallelStatusSummary `json:",inline"`

	// The status for each parallel index. The size of the list should be exactly
	// equal to the total parallelism factor, even if no tasks are created yet.
	Indexes []ParallelIndexStatus `json:"indexes"`
}

ParallelStatus stores the status of parallel indexes for a Job.

func (*ParallelStatus) DeepCopy added in v0.2.0

func (in *ParallelStatus) DeepCopy() *ParallelStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParallelStatus.

func (*ParallelStatus) DeepCopyInto added in v0.2.0

func (in *ParallelStatus) DeepCopyInto(out *ParallelStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParallelStatusCounters added in v0.2.0

type ParallelStatusCounters struct {
	// Total number of task parallel indexes that have created tasks.
	Created int64 `json:"created"`

	// Total number of task parallel indexes that are currently starting.
	Starting int64 `json:"starting"`

	// Total number of task parallel indexes that are currently running.
	Running int64 `json:"running"`

	// Total number of task parallel indexes that are currently in retry backoff.
	RetryBackoff int64 `json:"retryBackoff"`

	// Total number of task parallel indexes where all tasks are completely
	// terminated, including when no tasks are created.
	Terminated int64 `json:"terminated"`

	// Total number of task parallel indexes that are successful.
	Succeeded int64 `json:"succeeded"`

	// Total number of task parallel indexes that failed (including all retries).
	Failed int64 `json:"failed"`
}

ParallelStatusCounters stores counts of parallel indexes for a Job.

func (*ParallelStatusCounters) DeepCopy added in v0.2.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParallelStatusCounters.

func (*ParallelStatusCounters) DeepCopyInto added in v0.2.0

func (in *ParallelStatusCounters) DeepCopyInto(out *ParallelStatusCounters)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParallelStatusSummary added in v0.2.0

type ParallelStatusSummary struct {
	// If true, the job is complete and currently in the process of waiting for all
	// remaining tasks to be terminated.
	Complete bool `json:"complete"`

	// If complete, contains whether the job is successful according to the
	// ParallelCompletionStrategy.
	//
	// +optional
	Successful *bool `json:"successful,omitempty"`
}

ParallelStatusSummary stores the summary status of parallel indexes for a Job.

func (*ParallelStatusSummary) DeepCopy added in v0.2.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParallelStatusSummary.

func (*ParallelStatusSummary) DeepCopyInto added in v0.2.0

func (in *ParallelStatusSummary) DeepCopyInto(out *ParallelStatusSummary)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParallelismSpec added in v0.2.0

type ParallelismSpec struct {
	// Specifies an exact number of tasks to be run in parallel. The index number
	// can be retrieved via the "${task.index_num}" context variable.
	//
	// +optional
	WithCount *int64 `json:"withCount,omitempty"`

	// Specifies a list of keys corresponding to each task that will be run in
	// parallel. The index key can be retrieved via the "${task.index_key}" context
	// variable.
	//
	// +listType=atomic
	// +optional
	WithKeys []string `json:"withKeys,omitempty"`

	// Specifies a matrix of key-value pairs, with each key mapped to a list of
	// possible values, such that tasks will be started for each combination of
	// key-value pairs. The matrix values can be retrieved via context variables in
	// the following format: "${task.index_matrix.<key>}".
	//
	// +mapType=atomic
	// +optional
	WithMatrix map[string][]string `json:"withMatrix,omitempty"`

	// Defines when the Job will complete when there are multiple tasks running in
	// parallel. For example, if using the AllSuccessful strategy, the Job will only
	// terminate once all parallel tasks have terminated successfully, or once any
	// task has exhausted its maxAttempts limit.
	//
	// +optional
	CompletionStrategy ParallelCompletionStrategy `json:"completionStrategy,omitempty"`
}

ParallelismSpec specifies how to run multiple tasks in parallel in a Job.

func (*ParallelismSpec) DeepCopy added in v0.2.0

func (in *ParallelismSpec) DeepCopy() *ParallelismSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParallelismSpec.

func (*ParallelismSpec) DeepCopyInto added in v0.2.0

func (in *ParallelismSpec) DeepCopyInto(out *ParallelismSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ParallelismSpec) GetCompletionStrategy added in v0.2.0

func (in *ParallelismSpec) GetCompletionStrategy() ParallelCompletionStrategy

GetCompletionStrategy returns the completion strategy, otherwise returns a default.

type PodTemplateSpec added in v0.2.0

type PodTemplateSpec struct {
	// Standard object's metadata that will be added to Pod. More info:
	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	//
	// +kubebuilder:validation:XPreserveUnknownFields
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the pod. API docs:
	// https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#podspec-v1-core
	//
	// Supports context variable substitution in the following fields for containers
	// and initContainers: image, command, args, env.value
	//
	// +kubebuilder:validation:Type=object
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:validation:XPreserveUnknownFields
	// +mapType=atomic
	// +optional
	Spec corev1.PodSpec `json:"spec,omitempty"`
}

PodTemplateSpec describes the data a Pod should have when created from a template.

func (*PodTemplateSpec) ConvertToCoreSpec added in v0.2.0

func (p *PodTemplateSpec) ConvertToCoreSpec() *corev1.PodTemplateSpec

ConvertToCoreSpec converts a PodTemplateSpec into the equivalent v1.PodTemplateSpec. This method is needed because we use a custom PodTemplateSpec type for the purposes of custom CRD documentation generation.

func (*PodTemplateSpec) DeepCopy added in v0.2.0

func (in *PodTemplateSpec) DeepCopy() *PodTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTemplateSpec.

func (*PodTemplateSpec) DeepCopyInto added in v0.2.0

func (in *PodTemplateSpec) DeepCopyInto(out *PodTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ScheduleContraints

type ScheduleContraints struct {
	// Specifies the earliest possible time that is allowed to be scheduled. If set,
	// the scheduler should not create schedules before this time.
	//
	// +optional
	NotBefore *metav1.Time `json:"notBefore,omitempty"`

	// Specifies the latest possible time that is allowed to be scheduled. If set,
	// the scheduler should not create schedules after this time.
	//
	// +optional
	NotAfter *metav1.Time `json:"notAfter,omitempty"`
}

ScheduleContraints defines constraints for automatic scheduling.

func (*ScheduleContraints) DeepCopy

func (in *ScheduleContraints) DeepCopy() *ScheduleContraints

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleContraints.

func (*ScheduleContraints) DeepCopyInto

func (in *ScheduleContraints) DeepCopyInto(out *ScheduleContraints)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ScheduleSpec

type ScheduleSpec struct {
	// Specify a schedule using cron expressions.
	//
	// +optional
	Cron *CronSchedule `json:"cron,omitempty"`

	// If true, then automatic scheduling will be disabled for the JobConfig.
	// +optional
	Disabled bool `json:"disabled"`

	// Specifies any constraints that should apply to this Schedule.
	//
	// +optional
	Constraints *ScheduleContraints `json:"constraints,omitempty"`

	// Specifies the time that the schedule was last updated. This prevents
	// accidental back-scheduling.
	//
	// For example, if a JobConfig that was previously disabled from automatic
	// scheduling is now enabled, we do not want to perform back-scheduling for
	// schedules after LastScheduled prior to updating of the JobConfig.
	//
	// +optional
	LastUpdated *metav1.Time `json:"lastUpdated,omitempty"`
}

ScheduleSpec defines how a JobConfig should be automatically scheduled.

func (*ScheduleSpec) DeepCopy

func (in *ScheduleSpec) DeepCopy() *ScheduleSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleSpec.

func (*ScheduleSpec) DeepCopyInto

func (in *ScheduleSpec) DeepCopyInto(out *ScheduleSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SelectOptionConfig

type SelectOptionConfig struct {
	// Default value, will be used to populate the option if not specified.
	// +optional
	Default string `json:"default,omitempty"`

	// List of values to be chosen from.
	// +optional
	Values []string `json:"values"`

	// Whether to allow custom values instead of just the list of allowed values.
	//
	// Default: false
	// +optional
	AllowCustom bool `json:"allowCustom,omitempty"`
}

SelectOptionConfig defines the options for OptionTypeSelect.

func (*SelectOptionConfig) DeepCopy

func (in *SelectOptionConfig) DeepCopy() *SelectOptionConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectOptionConfig.

func (*SelectOptionConfig) DeepCopyInto

func (in *SelectOptionConfig) DeepCopyInto(out *SelectOptionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StartPolicySpec

type StartPolicySpec struct {
	// Specifies the behaviour when there are other concurrent jobs for the
	// JobConfig.
	ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy"`

	// Specifies the earliest time that the Job can be started after. Can be
	// specified together with other fields.
	//
	// +optional
	StartAfter *metav1.Time `json:"startAfter,omitempty"`
}

StartPolicySpec specifies certain conditions that have to be met before a Job can be started.

func (*StartPolicySpec) DeepCopy

func (in *StartPolicySpec) DeepCopy() *StartPolicySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StartPolicySpec.

func (*StartPolicySpec) DeepCopyInto

func (in *StartPolicySpec) DeepCopyInto(out *StartPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StringOptionConfig

type StringOptionConfig struct {
	// Optional default value, will be used to populate the option if not specified.
	// +optional
	Default string `json:"default,omitempty"`

	// Whether to trim spaces before substitution.
	//
	// Default: false
	// +optional
	TrimSpaces bool `json:"trimSpaces,omitempty"`
}

StringOptionConfig defines the options for OptionTypeString.

func (*StringOptionConfig) DeepCopy

func (in *StringOptionConfig) DeepCopy() *StringOptionConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringOptionConfig.

func (*StringOptionConfig) DeepCopyInto

func (in *StringOptionConfig) DeepCopyInto(out *StringOptionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskContainerState

type TaskContainerState struct {
	// Exit status from the last termination of the container
	ExitCode int32 `json:"exitCode"`

	// Signal from the last termination of the container
	// +optional
	Signal int32 `json:"signal,omitempty"`

	// Unique, one-word, CamelCase reason for the container's status.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Message regarding the container's status.
	// +optional
	Message string `json:"message,omitempty"`

	// Container ID of the container. May be empty if the container is not yet
	// created.
	// +optional
	ContainerID string `json:"containerID,omitempty"`
}

func (*TaskContainerState) DeepCopy

func (in *TaskContainerState) DeepCopy() *TaskContainerState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskContainerState.

func (*TaskContainerState) DeepCopyInto

func (in *TaskContainerState) DeepCopyInto(out *TaskContainerState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskRef

type TaskRef struct {
	// Name of the task. Assumes to share the same namespace as the Job.
	Name string `json:"name"`

	// Creation time of the task.
	CreationTimestamp metav1.Time `json:"creationTimestamp"`

	// Timestamp that the task transitioned to running. May be zero if the task was
	// never observed as started running.
	//
	// +optional
	RunningTimestamp *metav1.Time `json:"runningTimestamp,omitempty"`

	// Time that the task finished. Will always return a non-zero timestamp if task
	// is finished.
	//
	// +optional
	FinishTimestamp *metav1.Time `json:"finishTimestamp,omitempty"`

	// The retry index of the task, starting from 0 up to maxAttempts - 1.
	RetryIndex int64 `json:"retryIndex"`

	// If the Job is a parallel job, then contains the parallel index of the task.
	//
	// +optional
	ParallelIndex *ParallelIndex `json:"parallelIndex"`

	// Status of the task. This field will be reconciled from the relevant task
	// object, may not be always up-to-date. This field will persist the state of
	// tasks beyond the lifetime of the task resources, even if they are deleted.
	Status TaskStatus `json:"status"`

	// DeletedStatus, if set, specifies a placeholder Status of the task after it is
	// reconciled as deleted. If the task is deleted, Status cannot be reconciled
	// from the task any more, and instead uses information stored in DeletedStatus.
	// In other words, this field acts as a tombstone marker, and is only used after
	// the deletion of the task object is complete.
	//
	// While the task is in the process of being deleted (i.e. deletionTimestamp is
	// set but object still exists), Status will still be reconciled from the actual
	// task's status.
	//
	// If the task is already deleted and DeletedStatus is also not set, then the
	// task's state will be marked as TaskDeletedFinalStateUnknown.
	//
	// +optional
	DeletedStatus *TaskStatus `json:"deletedStatus,omitempty"`

	// Node name that the task was bound to. May be empty if task was never
	// scheduled.
	//
	// +optional
	NodeName string `json:"nodeName,omitempty"`

	// States of each container for the task. This field will be reconciled from the
	// relevant task object, and is not guaranteed to be up-to-date. This field will
	// persist the state of tasks beyond the lifetime of the task resources, even if
	// they were deleted.
	ContainerStates []TaskContainerState `json:"containerStates"`
}

TaskRef stores information about a Job's owned task.

func (*TaskRef) DeepCopy

func (in *TaskRef) DeepCopy() *TaskRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskRef.

func (*TaskRef) DeepCopyInto

func (in *TaskRef) DeepCopyInto(out *TaskRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskResult added in v0.2.0

type TaskResult string

TaskResult contains the result of a Task.

const (
	// TaskSucceeded means that the task finished successfully with no errors.
	TaskSucceeded TaskResult = "Succeeded"

	// TaskFailed means that the task exited with a non-zero code or some other
	// application-level error.
	TaskFailed TaskResult = "Failed"

	// TaskKilled means that the task is killed externally and now terminated.
	TaskKilled TaskResult = "Killed"
)

type TaskState

type TaskState string
const (
	// TaskStarting means that the task has not yet started running.
	TaskStarting TaskState = "Starting"

	// TaskRunning means that the task has started running successfully.
	TaskRunning TaskState = "Running"

	// TaskKilling means that the task is being killed externally but has not yet terminated.
	TaskKilling TaskState = "Killing"

	// TaskTerminated means that the task is terminated.
	TaskTerminated TaskState = "Terminated"

	// TaskDeletedFinalStateUnknown means that task was deleted and its final status
	// was unknown to the controller. This could happen if the task was force
	// deleted, or the controller lost the status of the task and it was already
	// deleted.
	TaskDeletedFinalStateUnknown TaskState = "DeletedFinalStateUnknown"
)

type TaskStatus

type TaskStatus struct {
	// State of the task.
	State TaskState `json:"state"`

	// If the state is Terminated, the result of the task.
	// +optional
	Result TaskResult `json:"result,omitempty"`

	// Unique, one-word, CamelCase reason for the task's status.
	// +optional
	Reason string `json:"reason,omitempty"`

	// Descriptive message for the task's status.
	// +optional
	Message string `json:"message,omitempty"`
}

TaskStatus stores the last known status of a Job's task.

func (*TaskStatus) DeepCopy

func (in *TaskStatus) DeepCopy() *TaskStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskStatus.

func (*TaskStatus) DeepCopyInto

func (in *TaskStatus) DeepCopyInto(out *TaskStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskTemplate added in v0.2.0

type TaskTemplate struct {
	// Describes how to create tasks as Pods.
	// +optional
	Pod *PodTemplateSpec `json:"pod,omitempty"`
}

TaskTemplate defines how to create a single task for this Job. Exactly one field must be specified.

func (*TaskTemplate) DeepCopy added in v0.2.0

func (in *TaskTemplate) DeepCopy() *TaskTemplate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TaskTemplate.

func (*TaskTemplate) DeepCopyInto added in v0.2.0

func (in *TaskTemplate) DeepCopyInto(out *TaskTemplate)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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