Documentation ¶
Overview ¶
Package pjutil contains helpers for working with ProwJobs.
Index ¶
- func BatchSpec(p config.Presubmit, refs kube.Refs) kube.ProwJobSpec
- func EnvForSpec(spec kube.ProwJobSpec) map[string]string
- func GetLatestPeriodics(pjs []kube.ProwJob) map[string]kube.ProwJob
- func NewProwJob(spec kube.ProwJobSpec) kube.ProwJob
- func PartitionPending(pjs []kube.ProwJob) (pending, nonPending chan kube.ProwJob)
- func PeriodicSpec(p config.Periodic) kube.ProwJobSpec
- func PostsubmitSpec(p config.Postsubmit, refs kube.Refs) kube.ProwJobSpec
- func PresubmitSpec(p config.Presubmit, refs kube.Refs) kube.ProwJobSpec
- func ProwJobToPod(pj kube.ProwJob, buildID string) *kube.Pod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvForSpec ¶
func EnvForSpec(spec kube.ProwJobSpec) map[string]string
EnvForSpec returns a mapping of environment variables to their values that should be available for a job spec
func GetLatestPeriodics ¶
GetLatestPeriodics filters through the provided prowjobs and returns a map of periodic jobs to their latest prowjobs.
func NewProwJob ¶
func NewProwJob(spec kube.ProwJobSpec) kube.ProwJob
NewProwJob initializes a ProwJob out of a ProwJobSpec.
func PartitionPending ¶
PartitionPending separates the provided prowjobs into pending and non-pending and returns them inside channels so that they can be consumed in parallel by different goroutines. Controller loops need to handle pending jobs first so they can conform to maximum concurrency requirements that different jobs may have.
func PeriodicSpec ¶
func PeriodicSpec(p config.Periodic) kube.ProwJobSpec
PeriodicSpec initializes a ProwJobSpec for a given periodic job.
func PostsubmitSpec ¶
func PostsubmitSpec(p config.Postsubmit, refs kube.Refs) kube.ProwJobSpec
PostsubmitSpec initializes a ProwJobSpec for a given postsubmit job.
func PresubmitSpec ¶
PresubmitSpec initializes a ProwJobSpec for a given presubmit job.
Types ¶
This section is empty.