Documentation ¶
Overview ¶
Package pjutil contains helpers for working with ProwJobs.
Index ¶
- Constants
- func BatchSpec(p config.Presubmit, refs kube.Refs) kube.ProwJobSpec
- func GetBuildID(name, totURL string) (string, error)
- func GetLatestProwJobs(pjs []kube.ProwJob, jobType kube.ProwJobType) map[string]kube.ProwJob
- func NewPresubmit(pr github.PullRequest, baseSHA string, job config.Presubmit, eventGUID string) kube.ProwJob
- func NewProwJob(spec kube.ProwJobSpec, labels map[string]string) kube.ProwJob
- func PartitionActive(pjs []kube.ProwJob) (pending, triggered chan kube.ProwJob)
- func PeriodicSpec(p config.Periodic) kube.ProwJobSpec
- func PeriodicToJobSpec(periodic config.Periodic) *downwardapi.JobSpec
- func PostsubmitSpec(p config.Postsubmit, refs kube.Refs) kube.ProwJobSpec
- func PostsubmitToJobSpec(post config.Postsubmit) *downwardapi.JobSpec
- func PresubmitSpec(p config.Presubmit, refs kube.Refs) kube.ProwJobSpec
- func PresubmitToJobSpec(pre config.Presubmit) *downwardapi.JobSpec
- func ProwJobFields(pj *kube.ProwJob) logrus.Fields
Constants ¶
const (
// JobSpecEnv is the name that contains JobSpec marshaled into a string.
JobSpecEnv = "JOB_SPEC"
)
Variables ¶
This section is empty.
Functions ¶
func GetBuildID ¶
GetBuildID calls out to `tot` in order to vend build identifier for the job
func GetLatestProwJobs ¶
GetLatestProwJobs filters through the provided prowjobs and returns a map of jobType jobs to their latest prowjobs.
func NewPresubmit ¶
func NewProwJob ¶
NewProwJob initializes a ProwJob out of a ProwJobSpec.
func PartitionActive ¶
PartitionActive separates the provided prowjobs into pending and triggered and returns them inside channels so that they can be consumed in parallel by different goroutines. Complete prowjobs are filtered out. 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 PeriodicToJobSpec ¶
func PeriodicToJobSpec(periodic config.Periodic) *downwardapi.JobSpec
PeriodicToJobSpec generates a downwardapi.JobSpec out of a Periodic. Useful for figuring out GCS paths when parsing jobs out of a prow config.
func PostsubmitSpec ¶
func PostsubmitSpec(p config.Postsubmit, refs kube.Refs) kube.ProwJobSpec
PostsubmitSpec initializes a ProwJobSpec for a given postsubmit job.
func PostsubmitToJobSpec ¶
func PostsubmitToJobSpec(post config.Postsubmit) *downwardapi.JobSpec
PostsubmitToJobSpec generates a downwardapi.JobSpec out of a Postsubmit. Useful for figuring out GCS paths when parsing jobs out of a prow config.
func PresubmitSpec ¶
PresubmitSpec initializes a ProwJobSpec for a given presubmit job.
func PresubmitToJobSpec ¶
func PresubmitToJobSpec(pre config.Presubmit) *downwardapi.JobSpec
PresubmitToJobSpec generates a downwardapi.JobSpec out of a Presubmit. Useful for figuring out GCS paths when parsing jobs out of a prow config.
Types ¶
This section is empty.