acorn-io / runtime

A simple application deployment framework built on Kubernetes
https://docs.acorn.io/
Apache License 2.0
1.14k stars 102 forks source link

feat: add support for jobs that are both cron and event based #2483

Closed thedadams closed 4 months ago

thedadams commented 4 months ago

Before this change, a cronjob that also specifies events would produce a cronjob that is only running after one of the events occurs and is deleted after a non-listed event. Additionally, a cronjob is not marked as "ready" until it runs at least once.

After this change, a cronjob is marked as ready unless it is running or failed. Additionally, a job that specifies both events and schedule, a cronjob is created for the schedule and a "regular" job for each event. Once the event-based job succeeds, the job's status is read from the cronjob. That means, if the "regular" job fails, then the job's status will be "failed" until the "regular" job passed, regardless of what is happening with the cronjob.

thedadams commented 4 months ago

I had this essentially done on Friday, so I was hoping to get it in if I could.