Documentation ¶
Overview ¶
Package config knows how to read and parse config.yaml.
Index ¶
- func SetRegexes(js []Presubmit) error
- type Agent
- type Brancher
- type Config
- func (c *Config) AllPeriodics() []Periodic
- func (c *Config) AllPostsubmits(repos []string) []Postsubmit
- func (c *Config) AllPresubmits(repos []string) []Presubmit
- func (c *Config) GetPresubmit(repo, jobName string) *Presubmit
- func (c *Config) MatchingPresubmits(fullRepoName, body string, testAll *regexp.Regexp) []Presubmit
- func (c *Config) RetestPresubmits(fullRepoName string, skipContexts, runContexts map[string]bool) []Presubmit
- func (c *Config) SetPresubmits(jobs map[string][]Presubmit) error
- type JenkinsOperator
- type Periodic
- type Plank
- type Postsubmit
- type Presubmit
- type PushGateway
- type Sinker
- type Tide
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRegexes ¶
SetRegexes compiles and validates all the regural expressions for the provided presubmits.
Types ¶
type Agent ¶
Agent watches a path and automatically loads the config stored therein.
type Brancher ¶
type Brancher struct { // Do not run against these branches. Default is no branches. SkipBranches []string `json:"skip_branches"` // Only run against these branches. Default is all branches. Branches []string `json:"branches"` }
Brancher is for shared code between jobs that only run against certain branches. An empty brancher runs against all branches.
func (Brancher) RunsAgainstAllBranch ¶
func (Brancher) RunsAgainstBranch ¶
type Config ¶
type Config struct { // Full repo name (such as "kubernetes/kubernetes") -> list of jobs. Presubmits map[string][]Presubmit `json:"presubmits,omitempty"` Postsubmits map[string][]Postsubmit `json:"postsubmits,omitempty"` // Periodics are not associated with any repo. Periodics []Periodic `json:"periodics,omitempty"` Tide Tide `json:"tide,omitempty"` Plank Plank `json:"plank,omitempty"` Sinker Sinker `json:"sinker,omitempty"` // TODO: Move this out of the main config. JenkinsOperator JenkinsOperator `json:"jenkins_operator,omitempty"` // ProwJobNamespace is the namespace in the cluster that prow // components will use for looking up ProwJobs. The namespace // needs to exist and will not be created by prow. // Defaults to "default". ProwJobNamespace string `json:"prowjob_namespace,omitempty"` // PodNamespace is the namespace in the cluster that prow // components will use for looking up Pods owned by ProwJobs. // The namespace needs to exist and will not be created by prow. // Defaults to "default". PodNamespace string `json:"pod_namespace,omitempty"` // LogLevel enables dynamically updating the log level of the // standard logger that is used by all prow components. // // Valid values: // // "debug", "info", "warn", "warning", "error", "fatal", "panic" // // Defaults to "info". LogLevel string `json:"log_level,omitempty"` // PushGateway is a prometheus push gateway. PushGateway PushGateway `json:"push_gateway,omitempty"` }
Config is a read-only snapshot of the config.
func (*Config) AllPeriodics ¶
AllPostsubmits returns all prow periodic jobs.
func (*Config) AllPostsubmits ¶
func (c *Config) AllPostsubmits(repos []string) []Postsubmit
AllPostsubmits returns all prow postsubmit jobs in repos. if repos is empty, return all postsubmits.
func (*Config) AllPresubmits ¶
AllPresubmits returns all prow presubmit jobs in repos. if repos is empty, return all presubmits.
func (*Config) GetPresubmit ¶
GetPresubmit returns the presubmit job for the provided repo and job name.
func (*Config) MatchingPresubmits ¶
func (*Config) RetestPresubmits ¶
func (c *Config) RetestPresubmits(fullRepoName string, skipContexts, runContexts map[string]bool) []Presubmit
RetestPresubmits returns all presubmits that should be run given a /retest command. This is the set of all presubmits intersected with ((alwaysRun + runContexts) - skipContexts)
type JenkinsOperator ¶
type JenkinsOperator struct { // JobURLTemplateString compiles into JobURLTemplate at load time. JobURLTemplateString string `json:"job_url_template,omitempty"` // JobURLTemplate is compiled at load time from JobURLTemplateString. It // will be passed a kube.ProwJob and is used to set the URL for the // "details" link on GitHub as well as the link from deck. JobURLTemplate *template.Template `json:"-"` // ReportTemplateString compiles into ReportTemplate at load time. ReportTemplateString string `json:"report_template,omitempty"` // ReportTemplate is compiled at load time from ReportTemplateString. It // will be passed a kube.ProwJob and can provide an optional blurb below // the test failures comment. ReportTemplate *template.Template `json:"-"` // MaxConcurrency is the maximum number of tests running concurrently that // will be allowed by jenkins-operator. 0 implies no limit. MaxConcurrency int `json:"max_concurrency,omitempty"` // AllowCancellations enables aborting presubmit jobs for commits that // have been superseded by newer commits in Github pull requests. AllowCancellations bool `json:"allow_cancellations"` }
JenkinsOperator is config for the jenkins-operator controller.
type Periodic ¶
type Periodic struct { Name string `json:"name"` // Agent that will take care of running this job. Agent string `json:"agent"` // Kubernetes pod spec. Spec *kube.PodSpec `json:"spec,omitempty"` // Interval to wait between two runs of the job. Interval string `json:"interval"` Tags []string `json:"tags,omitempty"` // Run these jobs after successfully running this one. RunAfterSuccess []Periodic `json:"run_after_success"` // contains filtered or unexported fields }
Periodic runs on a timer.
func (*Periodic) GetInterval ¶
func (*Periodic) SetInterval ¶
type Plank ¶
type Plank struct { // JobURLTemplateString compiles into JobURLTemplate at load time. JobURLTemplateString string `json:"job_url_template,omitempty"` // JobURLTemplate is compiled at load time from JobURLTemplateString. It // will be passed a kube.ProwJob and is used to set the URL for the // "details" link on GitHub as well as the link from deck. JobURLTemplate *template.Template `json:"-"` // ReportTemplateString compiles into ReportTemplate at load time. ReportTemplateString string `json:"report_template,omitempty"` // ReportTemplate is compiled at load time from ReportTemplateString. It // will be passed a kube.ProwJob and can provide an optional blurb below // the test failures comment. ReportTemplate *template.Template `json:"-"` // MaxConcurrency is the maximum number of tests running concurrently that // will be allowed by plank. 0 implies no limit. MaxConcurrency int `json:"max_concurrency,omitempty"` // AllowCancellations enables aborting presubmit jobs for commits that // have been superseded by newer commits in Github pull requests. AllowCancellations bool `json:"allow_cancellations"` }
Plank is config for the plank controller.
type Postsubmit ¶
type Postsubmit struct { Name string `json:"name"` // Agent that will take care of running this job. Agent string `json:"agent"` // Kubernetes pod spec. Spec *kube.PodSpec `json:"spec,omitempty"` // Maximum number of this job running concurrently, 0 implies no limit. MaxConcurrency int `json:"max_concurrency"` Brancher // Run these jobs after successfully running this one. RunAfterSuccess []Postsubmit `json:"run_after_success"` }
Postsubmit runs on push events.
type Presubmit ¶
type Presubmit struct { // eg kubernetes-pull-build-test-e2e-gce Name string `json:"name"` // Run for every PR, or only when a comment triggers it. AlwaysRun bool `json:"always_run"` // Run if the PR modifies a file that matches this regex. RunIfChanged string `json:"run_if_changed"` // Context line for GitHub status. Context string `json:"context"` // eg @k8s-bot e2e test this Trigger string `json:"trigger"` // Valid rerun command to give users. Must match Trigger. RerunCommand string `json:"rerun_command"` // Whether or not to skip commenting and setting status on GitHub. SkipReport bool `json:"skip_report"` // Maximum number of this job running concurrently, 0 implies no limit. MaxConcurrency int `json:"max_concurrency"` // Agent that will take care of running this job. Agent string `json:"agent"` // Kubernetes pod spec. Spec *kube.PodSpec `json:"spec,omitempty"` // Run these jobs after successfully running this one. RunAfterSuccess []Presubmit `json:"run_after_success"` Brancher // contains filtered or unexported fields }
Presubmit is the job-specific trigger info.
func (Presubmit) RunsAgainstChanges ¶
type PushGateway ¶
type PushGateway struct {
Endpoint string `json:"endpoint,omitempty"`
}
type Sinker ¶
type Sinker struct { // ResyncPeriodString compiles into ResyncPeriod at load time. ResyncPeriodString string `json:"resync_period,omitempty"` // ResyncPeriod is how often the controller will perform a garbage // collection. Defaults to one hour. ResyncPeriod time.Duration `json:"-"` // MaxProwJobAgeString compiles into MaxProwJobAge at load time. MaxProwJobAgeString string `json:"max_prowjob_age,omitempty"` // MaxProwJobAge is how old a ProwJob can be before it is garbage-collected. // Defaults to one week. MaxProwJobAge time.Duration `json:"-"` // MaxPodAgeString compiles into MaxPodAge at load time. MaxPodAgeString string `json:"max_pod_age,omitempty"` // MaxPodAge is how old a Pod can be before it is garbage-collected. // Defaults to one day. MaxPodAge time.Duration `json:"-"` }
Sinker is config for the sinker controller.