pjutil

package
v0.0.0-...-185445a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package pjutil contains helpers for working with ProwJobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchSpec

func BatchSpec(p config.Presubmit, refs kube.Refs) kube.ProwJobSpec

BatchSpec initializes a ProwJobSpec for a given batch job and ref spec.

func GetBuildID

func GetBuildID(name, totURL string) (string, error)

GetBuildID calls out to `tot` in order to vend build identifier for the job

func GetLatestProwJobs

func GetLatestProwJobs(pjs []kube.ProwJob, jobType kube.ProwJobType) map[string]kube.ProwJob

GetLatestProwJobs filters through the provided prowjobs and returns a map of jobType jobs to their latest prowjobs.

func NewPresubmit

func NewPresubmit(pr github.PullRequest, baseSHA string, job config.Presubmit, eventGUID string) kube.ProwJob

NewPresubmit converts a config.Presubmit into a kube.ProwJob. The kube.Refs are configured correctly per the pr, baseSHA. The eventGUID becomes a github.EventGUID label.

func NewProwJob

func NewProwJob(spec kube.ProwJobSpec, labels map[string]string) kube.ProwJob

NewProwJob initializes a ProwJob out of a ProwJobSpec.

func NewProwJobWithAnnotation

func NewProwJobWithAnnotation(spec kube.ProwJobSpec, labels, annotations map[string]string) kube.ProwJob

NewProwJobWithAnnotation initializes a ProwJob out of a ProwJobSpec with annotations.

func PartitionActive

func PartitionActive(pjs []kube.ProwJob) (pending, triggered chan kube.ProwJob)

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

func PresubmitSpec(p config.Presubmit, refs kube.Refs) kube.ProwJobSpec

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.

func ProwJobFields

func ProwJobFields(pj *kube.ProwJob) logrus.Fields

ProwJobFields extracts logrus fields from a prowjob useful for logging.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL