OS
Schema Hub

SuccessPolicy

SuccessPolicy describes when a Job can be declared as succeeded based on the success of some indexes.

Schema URL
https://raw.githubusercontent.com/nlamirault/schema-hub/main/schemas/batch.api.k8s.io/SuccessPolicy_v1.json
Usage examples
VS Code / yaml-language-server
# yaml-language-server: $schema=https://raw.githubusercontent.com/nlamirault/schema-hub/main/schemas/batch.api.k8s.io/SuccessPolicy_v1.json
kubeconform
kubeconform -schema-location 'https://raw.githubusercontent.com/nlamirault/schema-hub/main/schemas/{{ .Group }}/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json' manifest.yaml

Resource Structure

rulesarrayRequired
rules represents the list of alternative rules for the declaring the Jobs as successful before `.status.succeeded >= .spec.completions`. Once any of the rules are met, the "SuccessCriteriaMet" condition is added, and the lingering pods are removed. The terminal state for such a Job has the "Complete" condition. Additionally, these rules are evaluated in order; Once the Job meets one of the rules, other rules are ignored. At most 20 elements are allowed.