Closed kaushalnavneet closed 3 years ago
Per FAQ, cRonstrue doesn't try to validate cron expressions. Garbage in — garage out. I would recommend validating an expression before passing it into cRonstrue. It sounds like a tweak in cron-validator might be a good route here.
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 improve the description of the cron expression there. Since we usecronstrue
as an external package to generate the cron description strings. I'd like to raise an issue since theAt 08:00 AM, every 80 days
text is not correct. (FYI, we use cron-validator to validate the cron expression and it also doesn't consider it as an incorrect expression). If the frequency of the day (like in this example80
) exceeds the length of that month (28/30/31), it should show when the actual frequency happens (that is 1st day of the next month), not onevery 80 days
. PS: Tested with the latest version, it doesn't seem to address this issue.