Skip to content

Commit

Permalink
Allow overriding the job timeout when generating a Prow config file (k…
Browse files Browse the repository at this point in the history
  • Loading branch information
adrcunha authored and knative-prow-robot committed Mar 25, 2019
1 parent c3d2038 commit a26c88e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ci/prow/make_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ var (
jobNameFilter string
preCommand string
extraEnvVars stringArrayFlag
timeoutOverride int

// List of Knative repositories.
repositories []repositoryData
Expand Down Expand Up @@ -712,6 +713,10 @@ func parseBasicJobConfigOverrides(data *baseProwJobTemplateData, config yaml.Map
// Knock-out the item, signalling it was already parsed.
config[i] = yaml.MapItem{}
}
// Override any values if provided by command-line flags.
if timeoutOverride > 0 {
(*data).Timeout = timeoutOverride
}
}

// generatePresubmit generates all presubmit job configs for the given repo and configuration.
Expand Down Expand Up @@ -1485,6 +1490,7 @@ func main() {
flag.StringVar(&webhookAPICoverageScript, "webhookAPICoverageScript", "./test/apicoverage.sh", "Executable for running webhook apicoverage tool")
flag.StringVar(&cleanupScript, "cleanup-script", "./tools/cleanup/cleanup.sh", "Executable for running the cleanup tasks")
flag.StringVar(&repositoryOverride, "repo-override", "", "Repository path (github.com/foo/bar[=branch]) to use instead for a job")
flag.IntVar(&timeoutOverride, "timeout-override", 0, "Timeout (in minutes) to use instead for a job")
flag.StringVar(&jobNameFilter, "job-filter", "", "Generate only this job, instead of all jobs")
flag.StringVar(&preCommand, "pre-command", "", "Executable for running instead of the real command of a job")
flag.Var(&extraEnvVars, "extra-env", "Extra environment variables (key=value) to add to a job")
Expand Down

0 comments on commit a26c88e

Please sign in to comment.