-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron trigger does not support valid ranges #2034
Comments
I think that the change required to support ranges again could be small. The package that it's in use supports the creation of a Parser. Maybe it's possible to validate the values trying to parse them instead evaluate if they contain parser := cron.NewParser(cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)
if val, ok := config.TriggerMetadata["start"]; ok && val != "" {
_, err := parser.Parse(val)
if err != nil {
return nil, fmt.Errorf("error parsing start schedule. %s: range or hyphenated inputs are not allowed", config.TriggerMetadata)
}
meta.start = val
} else {
return nil, fmt.Errorf("no start schedule specified. %s", config.TriggerMetadata)
} Reviewing the code, apart from this validation, all should work without any other problem. As I can see, the process (in high level) is basically query the next start and the next end. |
@JorTurFer that sounds like a nice approach! Opening a PR is a good start 🙏 @Ritikaa96 FYI^ |
Cool! You can assign it to me if you want, I will do it during this week :) |
Any idea when the next release with this fix will be available? Thanks 😄 |
We typically ship every 2 months so that would be early October. |
If you need to try it before, you can use tag |
Yeah, but bear in mind that |
Thanks for the quick reply. I've built the images from |
Is this feature included in 2.5.0 release ? |
yes it is |
Report
Hello:
The fix for #1809 appears to have broken our cron setup. Checking for
-
removes some valid cron entries.Expected Behavior
Using the following, I would expect it to scale to 5 replicas in January, October, November, and December from 8:30 AM to 1:00 PM in the America/New_York TZ:
Actual Behavior
Steps to Reproduce the Problem
Apply any cron trigger with a range.
Logs from KEDA operator
No response
KEDA Version
2.4.0
Kubernetes Version
No response
Platform
Amazon Web Services
Scaler Details
Cron
Anything else?
No response
The text was updated successfully, but these errors were encountered: