job

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPods = errors.New("no pods found for job")

ErrNoPods reports that a Job controls no pod of its generation at all.

View Source
var ErrNoSucceededPod = errors.New("no succeeded pod found for job")

ErrNoSucceededPod reports that a Job has no pod in phase Succeeded for its generation (yet): the pod cache may lag the Job status, or the pods were garbage-collected. Callers decide between waiting and rebuilding.

Functions

func GetPodForJob

func GetPodForJob(ctx context.Context, c client.Client, job *batchv1.Job) (*corev1.Pod, error)

GetPodForJob returns a pod of the job's generation in ANY phase — the newest by creation timestamp. It is for diagnostics only (e.g. quoting a failed pod's termination message): never harvest a job's outputs from it, since a Job that succeeded on retry also owns the Failed pods of its earlier attempts. Use GetSucceededPodForJob to harvest. Returns an error wrapping ErrNoPods when there is none. See kdex-tech/host-manager#301.

func GetSucceededPodForJob added in v0.34.2

func GetSucceededPodForJob(ctx context.Context, c client.Client, job *batchv1.Job) (*corev1.Pod, error)

GetSucceededPodForJob returns the newest pod of the job's generation whose phase is Succeeded — the only pod whose termination messages are the job's outputs. A Failed pod's container is terminated too, and its termination message is the failure text (e.g. a runc mount error), which pre-#301 was recorded as the packages image digest. Returns an error wrapping ErrNoSucceededPod when there is none.

Types

This section is empty.

Jump to

Keyboard shortcuts

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