Documentation
¶
Index ¶
- Variables
- func GetContainerStartTime(pod *corev1.Pod) metav1.Time
- func GetContainerTerminateTime(pod *corev1.Pod) metav1.Time
- func GetPodConditionInitialized(pod *corev1.Pod) *corev1.PodCondition
- func GetPodConditionScheduled(pod *corev1.Pod) *corev1.PodCondition
- func GetTerminationStatus(container *corev1.ContainerStatus) *corev1.ContainerStateTerminated
- func IsPodConditionScheduled(pod *corev1.Pod) bool
- func LabelPodsForJob(rj *execution.Job) labels.Set
- func NewExecutor(clientsets controllercontext.Clientsets, informers controllercontext.Informers, ...) tasks.Executor
- func NewFactory(clientsets controllercontext.Clientsets, informers controllercontext.Informers) tasks.ExecutorFactory
- func NewPod(rj *execution.Job, template *corev1.PodTemplateSpec, index tasks.TaskIndex) (*corev1.Pod, error)
- func SubstitutePodSpec(rj *execution.Job, podSpec v1.PodSpec, taskSpec variablecontext.TaskSpec) v1.PodSpec
- type PodTask
- func (p *PodTask) GetContainerStates() []execution.TaskContainerState
- func (p *PodTask) GetFinishTimestamp() metav1.Time
- func (p *PodTask) GetKind() string
- func (p *PodTask) GetParallelIndex() (*execution.ParallelIndex, bool)
- func (p *PodTask) GetReasonMessage() (string, string)
- func (p *PodTask) GetResult() execution.TaskResult
- func (p *PodTask) GetRetryIndex() (int64, bool)
- func (p *PodTask) GetRunningTimestamp() metav1.Time
- func (p *PodTask) GetState() execution.TaskState
- func (p *PodTask) GetTaskRef() execution.TaskRef
- func (p *PodTask) IsFinished() bool
- func (p *PodTask) IsOOMKilled() bool
- func (p *PodTask) RequiresKillWithDeletion() bool
- type PodTaskClient
- func (p *PodTaskClient) CreateIndex(ctx context.Context, index tasks.TaskIndex) (tasks.Task, error)
- func (p *PodTaskClient) Delete(ctx context.Context, name string, force bool) error
- func (p *PodTaskClient) Get(ctx context.Context, name string) (tasks.Task, error)
- func (p *PodTaskClient) Index(ctx context.Context, index tasks.TaskIndex) (tasks.Task, error)
- type PodTaskLister
Constants ¶
This section is empty.
Variables ¶
var ( // LabelKeyJobUID label is added on Pods to identify the parent Job by UID. LabelKeyJobUID = executiongroup.AddGroupToLabel("job-uid") // LabelKeyTaskRetryIndex label is added on Pods to indicate the retry index of // the task. LabelKeyTaskRetryIndex = executiongroup.AddGroupToLabel("task-retry-index") // LabelKeyTaskParallelIndexHash label is added on Pods to indicate the parallel // index hash of the task. LabelKeyTaskParallelIndexHash = executiongroup.AddGroupToLabel("task-parallel-index-hash") // AnnotationKeyTaskParallelIndex annotations is added on Pods to indicate the parallel // index of the task in JSON format. AnnotationKeyTaskParallelIndex = executiongroup.AddGroupToLabel("task-parallel-index") )
Functions ¶
func GetContainerStartTime ¶
GetContainerStartTime returns the latest timestamp that any container started running.
func GetContainerTerminateTime ¶
GetContainerTerminateTime returns the latest timestamp at which any container terminated.
func GetPodConditionInitialized ¶
func GetPodConditionInitialized(pod *corev1.Pod) *corev1.PodCondition
GetPodConditionInitialized returns the PodInitialized pod condition.
func GetPodConditionScheduled ¶
func GetPodConditionScheduled(pod *corev1.Pod) *corev1.PodCondition
GetPodConditionScheduled returns the PodScheduled pod condition.
func GetTerminationStatus ¶
func GetTerminationStatus(container *corev1.ContainerStatus) *corev1.ContainerStateTerminated
GetTerminationStatus returns either the current container's Terminated or LastTerminateState.
func IsPodConditionScheduled ¶
IsPodConditionScheduled returns whether the pod has been scheduled. This does not necessarily mean that the pod is currently in a Scheduled state.
func LabelPodsForJob ¶
LabelPodsForJob returns a labels.Set that labels all Pods for a Job.
func NewExecutor ¶
func NewExecutor( clientsets controllercontext.Clientsets, informers controllercontext.Informers, rj *execution.Job, ) tasks.Executor
NewExecutor returns a new tasks.Executor which lists and operates on Pods.
func NewFactory ¶
func NewFactory(clientsets controllercontext.Clientsets, informers controllercontext.Informers) tasks.ExecutorFactory
NewFactory returns a new tasks.ExecutorFactory to return a Pod task executor.
func NewPod ¶
func NewPod( rj *execution.Job, template *corev1.PodTemplateSpec, index tasks.TaskIndex, ) (*corev1.Pod, error)
NewPod returns a new Pod object for the given Job.
func SubstitutePodSpec ¶ added in v0.2.0
func SubstitutePodSpec( rj *execution.Job, podSpec v1.PodSpec, taskSpec variablecontext.TaskSpec, ) v1.PodSpec
SubstitutePodSpec returns a PodSpec after substituting context variables.
Types ¶
type PodTask ¶
PodTask is a wrapper around Pod that fulfils Task.
func NewPodTask ¶
func NewPodTask(pod *corev1.Pod, client v1.PodInterface) *PodTask
func (*PodTask) GetContainerStates ¶
func (p *PodTask) GetContainerStates() []execution.TaskContainerState
func (*PodTask) GetFinishTimestamp ¶
func (*PodTask) GetParallelIndex ¶ added in v0.2.0
func (p *PodTask) GetParallelIndex() (*execution.ParallelIndex, bool)
func (*PodTask) GetReasonMessage ¶
func (*PodTask) GetResult ¶
func (p *PodTask) GetResult() execution.TaskResult
func (*PodTask) GetRetryIndex ¶
func (*PodTask) GetRunningTimestamp ¶
func (*PodTask) GetTaskRef ¶
func (*PodTask) IsFinished ¶
func (*PodTask) IsOOMKilled ¶
func (*PodTask) RequiresKillWithDeletion ¶
RequiresKillWithDeletion returns true if the Task should be killed with deletion instead of active deadline. Currently, we only enforce deletion if the Pod is not yet scheduled, otherwise we should always use kill timestamp to allow for graceful termination.
type PodTaskClient ¶
type PodTaskClient struct {
// contains filtered or unexported fields
}
PodTaskClient operates on Pod tasks.
func NewPodTaskClient ¶
func NewPodTaskClient(client v1.PodInterface, rj *execution.Job) *PodTaskClient
func (*PodTaskClient) CreateIndex ¶
type PodTaskLister ¶
type PodTaskLister struct {
// contains filtered or unexported fields
}
PodTaskLister lists Pod tasks.
func NewPodTaskLister ¶
func NewPodTaskLister( podLister corev1lister.PodLister, client v1.PodInterface, rj *execution.Job, ) *PodTaskLister