Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPods = errors.New("no pods found for job")
ErrNoPods reports that a Job controls no pod of its generation at all.
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 ¶
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.