Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
Lister() TaskLister
Client() TaskClient
}
Executor is a task executor interface.
type ExecutorFactory ¶
ExecutorFactory produces task executors.
type Task ¶
type Task interface {
// GetName returns the Task's name.
GetName() string
// GetTaskRef returns an immutable copy of the Task.
GetTaskRef() execution.TaskRef
// GetKind returns the kind of the task.
GetKind() string
// GetRetryIndex returns the retry index for the task.
// All tasks should be numbered sequentially starting from 1 for a single job.
GetRetryIndex() (int64, bool)
// RequiresKillWithDeletion returns true if the task cannot be killed via kill
// timestamp and needs deletion instead. If the task is already finished, this
// should always return false (i.e. cannot/should not kill finished tasks).
RequiresKillWithDeletion() bool
// GetKillTimestamp returns the timestamp that we previously set to kill the task.
GetKillTimestamp() *metav1.Time
// SetKillTimestamp will set the time which we want to kill the task.
SetKillTimestamp(ctx context.Context, ts time.Time) error
// GetKilledFromPendingTimeoutMarker returns true if the task was marked as killed from a pending timeout.
GetKilledFromPendingTimeoutMarker() bool
// SetKilledFromPendingTimeoutMarker marks the task as killed from a pending timeout.
SetKilledFromPendingTimeoutMarker(ctx context.Context) error
// GetDeletionTimestamp returns the timestamp that the task was requested to be deleted.
GetDeletionTimestamp() *metav1.Time
}
Task is implemented by Kubernetes resource definitions that encapsulate a single Job task on the cluster. This could be backed by a Pod, etc.
type TaskClient ¶
type TaskClient interface {
// CreateIndex creates a new Task with the given index.
CreateIndex(ctx context.Context, index int64) (task Task, err error)
// Get returns a single Task from apiserver.
Get(ctx context.Context, name string) (Task, error)
// Index returns a single Task for the given index from apiserver.
Index(ctx context.Context, index int64) (Task, error)
// Delete will delete the Task with the given name.
Delete(ctx context.Context, name string, force bool) error
}
TaskClient implements methods to perform operations on the apiserver.
Click to show internal directories.
Click to hide internal directories.