You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is caught in a Timed Trigger type for a Tekton pipeline.
When I set the cron expression 0 8 */80 * * for a job and it shows At 08:00 AM, every 80 days there. But actually, there is no such cron expression that will work for every 80 days. The expression above means At 08:00 on every 80th day-of-month, but eventually, this job runs on the 1st of every month. We could probably add validation for such scenarios when the frequency of the day (or any other component) exceeds the maximum length.
We use cron-validator to validate the cron expression and it doesn't seem to consider it as an incorrect expression. If the frequency of the day (like in this example 80) exceeds the length of days of that month (28 or 30 or 31), it should not pass it as a valid expression because the actual frequency happens on the 1st day of the next month, not on every 80 days.
The code being used:
According the cron syntax spec, there is no limit to the steps values (aside from the divide by 0 you filed earlier), which I assume was to make it easier to parse at the time. I could add the limits though I don't have the time for this feature right away.
You could try out the cron-validate library for the time being, as they already have a way to specify limits I think (though not sure if they apply to steps).
This issue is caught in a Timed Trigger type for a Tekton pipeline.
When I set the cron expression
0 8 */80 * *
for a job and it showsAt 08:00 AM, every 80 days
there. But actually, there is no such cron expression that will work for every 80 days. The expression above meansAt 08:00 on every 80th day-of-month
, but eventually, this job runs on the 1st of every month. We could probably add validation for such scenarios when the frequency of the day (or any other component) exceeds the maximum length.We use cron-validator to validate the cron expression and it doesn't seem to consider it as an incorrect expression. If the frequency of the day (like in this example
80
) exceeds the length of days of that month (28 or 30 or 31
), it should not pass it as a valid expression because the actual frequency happens on the 1st day of the next month, not on every 80 days.The code being used:
Expected:
cron.isValidCron(...)
should return false when the frequency exceeds the maximum length.Routed here based on the recommendation from
cronstrue
.PS: Tested with the latest version, it doesn't seem to address this issue.
The text was updated successfully, but these errors were encountered: