βοΈ Ensure CronJob scheduler is valid
You should always confirm that the cron schedule expression is valid or your jobs won't be executed.
Targeted objects by this rule (types of kind
): CronJob
Complexity: easy (What does this mean?)
Policy as code identifier: CRONJOB_INVALID_SCHEDULE_VALUE
This rule will failβ
If the schedule
value is not a valid cron expression
kind: CronJob
spec:
schedule: "1 * * *"
Rule output in the CLIβ
$ datree test *.yaml
>> File: failExample.yaml
β Ensure CronJob scheduler is valid [1 occurrence]
π‘ Incorrect value for key `schedule` - the (cron) schedule expressions is not valid and, therefore, will not work as expected
How to fix this failureβ
Specify a valid cron expression
kind: CronJob
spec:
schedule: "*/1 * * * *"