Documentation
¶
Overview ¶
Package v1 is the v1 version of the API. +groupName=prow.k8s.io
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type DecorationConfig
- type GCSConfiguration
- type ProwJob
- type ProwJobAgent
- type ProwJobList
- type ProwJobSpec
- type ProwJobState
- type ProwJobStatus
- type ProwJobType
- type Pull
- type Refs
- type UtilityImages
Constants ¶
const ( // PresubmitJob means it runs on unmerged PRs. PresubmitJob ProwJobType = "presubmit" // PostsubmitJob means it runs on each new commit. PostsubmitJob = "postsubmit" // Periodic job means it runs on a time-basis, unrelated to git changes. PeriodicJob = "periodic" // BatchJob tests multiple unmerged PRs at the same time. BatchJob = "batch" )
Various job types.
const ( // TriggeredState means the job has been created but not yet scheduled. TriggeredState ProwJobState = "triggered" // PendingState means the job is scheduled but not yet running. PendingState = "pending" // SuccessState means the job completed without error (exit 0) SuccessState = "success" // FailureState means the job completed with errors (exit non-zero) FailureState = "failure" // AbortedState means prow killed the job early (new commit pushed, perhaps). AbortedState = "aborted" // ErrorState means the job could not schedule (bad config, perhaps). ErrorState = "error" )
Various job states.
const ( // KubernetesAgent means prow will create a pod to run this job. KubernetesAgent ProwJobAgent = "kubernetes" // JenkinsAgent means prow will schedule the job on jenkins. JenkinsAgent = "jenkins" // BuildAgent means prow will schedule the job via a build-crd resource. BuildAgent = "build" )
const ( PathStrategyLegacy = "legacy" PathStrategySingle = "single" PathStrategyExplicit = "explicit" )
PathStrategy specifies minutia about how to contruct the url. Usually consumed by gubernator/testgrid.
const (
// DefaultClusterAlias specifies the default cluster key to schedule jobs.
DefaultClusterAlias = "default"
)
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: prowjobs.GroupName, Version: "v1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type DecorationConfig ¶
type DecorationConfig struct {
// Timeout is how long the pod utilities will wait
// before aborting a job with SIGINT.
Timeout time.Duration `json:"timeout,omitempty"`
// GracePeriod is how long the pod utilities will wait
// after sending SIGINT to send SIGKILL when aborting
// a job. Only applicable if decorating the PodSpec.
GracePeriod time.Duration `json:"grace_period,omitempty"`
// UtilityImages holds pull specs for utility container
// images used to decorate a PodSpec.
UtilityImages *UtilityImages `json:"utility_images,omitempty"`
// GCSConfiguration holds options for pushing logs and
// artifacts to GCS from a job.
GCSConfiguration *GCSConfiguration `json:"gcs_configuration,omitempty"`
// GCSCredentialsSecret is the name of the Kubernetes secret
// that holds GCS push credentials
GCSCredentialsSecret string `json:"gcs_credentials_secret,omitempty"`
// SSHKeySecrets are the names of Kubernetes secrets that contain
// SSK keys which should be used during the cloning process
SSHKeySecrets []string `json:"ssh_key_secrets,omitempty"`
// SkipCloning determines if we should clone source code in the
// initcontainers for jobs that specify refs
SkipCloning bool `json:"skip_cloning,omitempty"`
}
DecorationConfig specifies how to augment pods.
This is primarily used to provide automatic integration with gubernator and testgrid.
func (*DecorationConfig) DeepCopy ¶
func (in *DecorationConfig) DeepCopy() *DecorationConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecorationConfig.
func (*DecorationConfig) DeepCopyInto ¶
func (in *DecorationConfig) DeepCopyInto(out *DecorationConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GCSConfiguration ¶
type GCSConfiguration struct {
// Bucket is the GCS bucket to upload to
Bucket string `json:"bucket,omitempty"`
// PathPrefix is an optional path that follows the
// bucket name and comes before any structure
PathPrefix string `json:"path_prefix,omitempty"`
// PathStrategy dictates how the org and repo are used
// when calculating the full path to an artifact in GCS
PathStrategy string `json:"path_strategy,omitempty"`
// DefaultOrg is omitted from GCS paths when using the
// legacy or simple strategy
DefaultOrg string `json:"default_org,omitempty"`
// DefaultRepo is omitted from GCS paths when using the
// legacy or simple strategy
DefaultRepo string `json:"default_repo,omitempty"`
}
GCSConfiguration holds options for pushing logs and artifacts to GCS from a job.
func (*GCSConfiguration) DeepCopy ¶
func (in *GCSConfiguration) DeepCopy() *GCSConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCSConfiguration.
func (*GCSConfiguration) DeepCopyInto ¶
func (in *GCSConfiguration) DeepCopyInto(out *GCSConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProwJob ¶
type ProwJob struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ProwJobSpec `json:"spec,omitempty"`
Status ProwJobStatus `json:"status,omitempty"`
}
ProwJob contains the spec as well as runtime metadata.
func (*ProwJob) ClusterAlias ¶
ClusterAlias specifies the key in the clusters map to use.
This allows scheduling a prow job somewhere aside from the default build cluster.
func (*ProwJob) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwJob.
func (*ProwJob) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ProwJob) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*ProwJob) SetComplete ¶
func (j *ProwJob) SetComplete()
SetComplete marks the job as completed (at time now).
type ProwJobAgent ¶
type ProwJobAgent string
ProwJobAgent specifies the controller (such as plank or jenkins-agent) that runs the job.
type ProwJobList ¶
type ProwJobList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ProwJob `json:"items"`
}
VirtualMachineList is a list of VirtualMachine resources
func (*ProwJobList) DeepCopy ¶
func (in *ProwJobList) DeepCopy() *ProwJobList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwJobList.
func (*ProwJobList) DeepCopyInto ¶
func (in *ProwJobList) DeepCopyInto(out *ProwJobList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ProwJobList) DeepCopyObject ¶
func (in *ProwJobList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ProwJobSpec ¶
type ProwJobSpec struct {
// Type is the type of job and informs how
// the jobs is triggered
Type ProwJobType `json:"type,omitempty"`
// Agent determines which controller fulfills
// this specific ProwJobSpec and runs the job
Agent ProwJobAgent `json:"agent,omitempty"`
// Cluster is which Kubernetes cluster is used
// to run the job, only applicable for that
// specific agent
Cluster string `json:"cluster,omitempty"`
// Job is the name of the job
Job string `json:"job,omitempty"`
// Refs is the code under test, determined at
// runtime by Prow itself
Refs *Refs `json:"refs,omitempty"`
// ExtraRefs are auxiliary repositories that
// need to be cloned, determined from config
ExtraRefs []*Refs `json:"extra_refs,omitempty"`
// Report determines if the result of this job should
// be posted as a status on GitHub
Report bool `json:"report,omitempty"`
// Context is the name of the status context used to
// report back to GitHub
Context string `json:"context,omitempty"`
// RerunCommand is the command a user would write to
// trigger this job on their pull request
RerunCommand string `json:"rerun_command,omitempty"`
// MaxConcurrency restricts the total number of instances
// of this job that can run in parallel at once
MaxConcurrency int `json:"max_concurrency,omitempty"`
// PodSpec provides the basis for running the test under
// a Kubernetes agent
PodSpec *corev1.PodSpec `json:"pod_spec,omitempty"`
// BuildSpec provides the basis for running the test as
// a build-crd resource
// https://github.com/knative/build
BuildSpec *buildv1alpha1.BuildSpec `json:"build_spec,omitempty"`
// DecorationConfig holds configuration options for
// decorating PodSpecs that users provide
DecorationConfig *DecorationConfig `json:"decoration_config,omitempty"`
// RunAfterSuccess are jobs that should be triggered if
// this job runs and does not fail
RunAfterSuccess []ProwJobSpec `json:"run_after_success,omitempty"`
}
ProwJobSpec configures the details of the prow job.
Details include the podspec, code to clone, the cluster it runs any child jobs, concurrency limitations, etc.
func (*ProwJobSpec) DeepCopy ¶
func (in *ProwJobSpec) DeepCopy() *ProwJobSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwJobSpec.
func (*ProwJobSpec) DeepCopyInto ¶
func (in *ProwJobSpec) DeepCopyInto(out *ProwJobSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ProwJobStatus ¶
type ProwJobStatus struct {
StartTime metav1.Time `json:"startTime,omitempty"`
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
State ProwJobState `json:"state,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
// PodName applies only to ProwJobs fulfilled by
// plank. This field should always be the same as
// the ProwJob.ObjectMeta.Name field.
PodName string `json:"pod_name,omitempty"`
// BuildID is the build identifier vended either by tot
// or the snowflake library for this job and used as an
// identifier for grouping artifacts in GCS for views in
// TestGrid and Gubernator. Idenitifiers vended by tot
// are monotonically increasing whereas identifiers vended
// by the snowflake library are not.
BuildID string `json:"build_id,omitempty"`
// JenkinsBuildID applies only to ProwJobs fulfilled
// by the jenkins-operator. This field is the build
// identifier that Jenkins gave to the build for this
// ProwJob.
JenkinsBuildID string `json:"jenkins_build_id,omitempty"`
}
ProwJobStatus provides runtime metadata, such as when it finished, whether it is running, etc.
func (*ProwJobStatus) DeepCopy ¶
func (in *ProwJobStatus) DeepCopy() *ProwJobStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwJobStatus.
func (*ProwJobStatus) DeepCopyInto ¶
func (in *ProwJobStatus) DeepCopyInto(out *ProwJobStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Pull ¶
type Pull struct {
Number int `json:"number,omitempty"`
Author string `json:"author,omitempty"`
SHA string `json:"sha,omitempty"`
// Ref is git ref can be checked out for a change
// for example,
// github: pull/123/head
// gerrit: refs/changes/00/123/1
Ref string `json:"ref,omitempty"`
}
Pull describes a pull request at a particular point in time.
func (*Pull) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pull.
func (*Pull) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Refs ¶
type Refs struct {
// Org is something like kubernetes or k8s.io
Org string `json:"org,omitempty"`
// Repo is something like test-infra
Repo string `json:"repo,omitempty"`
BaseRef string `json:"base_ref,omitempty"`
BaseSHA string `json:"base_sha,omitempty"`
Pulls []Pull `json:"pulls,omitempty"`
// PathAlias is the location under <root-dir>/src
// where this repository is cloned. If this is not
// set, <root-dir>/src/github.com/org/repo will be
// used as the default.
PathAlias string `json:"path_alias,omitempty"`
// CloneURI is the URI that is used to clone the
// repository. If unset, will default to
// `https://github.com/org/repo.git`.
CloneURI string `json:"clone_uri,omitempty"`
}
Refs describes how the repo was constructed.
func (*Refs) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Refs.
func (*Refs) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UtilityImages ¶
type UtilityImages struct {
// CloneRefs is the pull spec used for the clonerefs utility
CloneRefs string `json:"clonerefs,omitempty"`
// InitUpload is the pull spec used for the initupload utility
InitUpload string `json:"initupload,omitempty"`
// Entrypoint is the pull spec used for the entrypoint utility
Entrypoint string `json:"entrypoint,omitempty"`
// sidecar is the pull spec used for the sidecar utility
Sidecar string `json:"sidecar,omitempty"`
}
UtilityImages holds pull specs for the utility images to be used for a job
func (*UtilityImages) DeepCopy ¶
func (in *UtilityImages) DeepCopy() *UtilityImages
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UtilityImages.
func (*UtilityImages) DeepCopyInto ¶
func (in *UtilityImages) DeepCopyInto(out *UtilityImages)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.