By default, the cron job allows concurrently running jobs but generally speaking, the behavior of your cron jobs will be more deterministic if you prevent them from running concurrently. Allowing concurrent cron jobs often requires locking mechanisms (to avoid race conditions) in addition to startup/cleanup handling.
Targeted resources by this rule (types of
Enabled by default? False
Policy as code identifier: CRONJOB_MISSING_CONCURRENCYPOLICY_KEY
This rule will fail
If a CronJob doesn't have
concurrencyPolicy set or
concurrencyPolicy is set to Allow
schedule: "*/1 * * * *"
Rule output in the CLI
$ datree test *.yaml
>> File: failExample.yaml
❌ Prevent CronJob from executing jobs concurrently [1 occurrence]
💡 Missing property object `concurrencyPolicy` - the behavior will be more deterministic when the jobs run one at a time
How to fix this failure
concurrencyPolicy to either Forbid or Replace