Job Notes

1 min read

Inspect batch/v1 Job status fields. Use to gate dependent resources on Job lifecycle conditions — cleanup tasks, chained workflows, migration guards.

Reference

NoteSignatureReturns
jobSucceededobjbool — at least one pod succeeded
jobFailedobjbool — at least one pod failed
jobActiveobjbool — at least one pod currently running

Examples

# Gate the application Deployment on a successful migration Job
when:
  - field: "{{ jobSucceeded .children.migrationJob }}"
    equals: "true"
  - field: "{{ jobFailed .children.migrationJob }}"
    equals: "false"

# Block creation while Job is still running
when:
  - field: "{{ jobActive .children.migrationJob }}"
    equals: "false"

# Status: surface job phase
- path: migrationStatus
  value: >
    {{ if jobSucceeded .children.migrationJob }}Complete
    {{ else if jobFailed .children.migrationJob }}Failed
    {{ else if jobActive .children.migrationJob }}Running
    {{ else }}Pending{{ end }}