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
Add cron definition to prow. #1895
Conversation
prow/cmd/hook/main.go
Outdated
@@ -46,6 +46,7 @@ var ( | |||
|
|||
presubmit = flag.String("presubmits", "/etc/jobs/presubmit", "Path to presubmit.yaml.") | |||
postsubmit = flag.String("postsubmits", "/etc/jobs/postsubmit", "Path to postsubmit.yaml.") | |||
cron = flag.String("crons", "/etc/jobs/cron", "Path to cron.yaml.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traditionally, this would be called crontab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose, but it's not the same format at all. It might be more confusing to call it that...
prow/jobs/jobs.go
Outdated
} | ||
for _, js := range nj { | ||
for j := range js { | ||
d, err := time.ParseDuration(js[j].Duration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this time between runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, duration is a lousy name. I'll call it interval instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This does *not* add any code to actually run the jobs. It's only the spec and associated plumbing. The plumbing should be cleaned up soon, since this is a pretty gross commit.
@rmmh rebased, PTAL |
} | ||
for _, js := range nj { | ||
for j := range js { | ||
d, err := time.ParseDuration(js[j].Interval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious here, seems ParseDuration
does not handle cron string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that's why it's "interval". Rather than saying a cron string you say a golang interval, such as 5m
or 1h30m
.
It might be worth not even invoking the word "cron", since it's clearly pretty confusing :-) If there are "presubmit" and "postsubmit", maybe a "periodic" section of the unified config.yaml would be appropriate? |
Done. |
@k8s-bot bazel test this |
/lgtm feel free to squash |
Automatic merge from submit-queue Don't make subdirs when publishing client-go Part of the client-go restructuring effort. This PR make publisher not to create subdirectories in client-go. The latest commit in https://github.com/caesarxuchao/client-go/commits/master is a sample commit.
First commit is from #1891, please only review the second. There is still more cleanup to do in the next PR before I actually write the code that runs the jobs.