v1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is the v1 version of the API. +groupName=prow.k8s.io

Index

Constants

View Source
const (
	// StartedStatusFile is the JSON file that stores information about the build
	// at the start of the build. See testgrid/metadata/job.go for more details.
	StartedStatusFile = "started.json"

	// FinishedStatusFile is the JSON file that stores information about the build
	// after its completion. See testgrid/metadata/job.go for more details.
	FinishedStatusFile = "finished.json"

	// ProwJobFile is the JSON file that stores the prowjob information.
	ProwJobFile = "prowjob.json"

	// CloneRecordFile is the JSON file that stores clone records of a prowjob.
	CloneRecordFile = "clone-records.json"
)
View Source
const (
	PathStrategyLegacy   = "legacy"
	PathStrategySingle   = "single"
	PathStrategyExplicit = "explicit"
)

PathStrategy specifies minutia about how to construct the url. Usually consumed by gubernator/testgrid.

View Source
const (
	// DefaultClusterAlias specifies the default cluster key to schedule jobs.
	DefaultClusterAlias = "default"
)

Variables

View Source
var (
	// SchemeBuilder collects functions that add things to a scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme applies all the stored functions to the scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: prowjobs.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CensoringOptions

type CensoringOptions struct {
	// CensoringConcurrency is the maximum number of goroutines that should be censoring
	// artifacts and logs at any time. If unset, defaults to 10.
	CensoringConcurrency *int64 `json:"censoring_concurrency,omitempty"`
	// CensoringBufferSize is the size in bytes of the buffer allocated for every file
	// being censored. We want to keep as little of the file in memory as possible in
	// order for censoring to be reasonably performant in space. However, to guarantee
	// that we censor every instance of every secret, our buffer size must be at least
	// two times larger than the largest secret we are about to censor. While that size
	// is the smallest possible buffer we could use, if the secrets being censored are
	// small, censoring will not be performant as the number of I/O actions per file
	// would increase. If unset, defaults to 10MiB.
	CensoringBufferSize *int `json:"censoring_buffer_size,omitempty"`

	// IncludeDirectories are directories which should have their content censored. If
	// present, only content in these directories will be censored. Entries in this list
	// are relative to $ARTIFACTS and are parsed with the go-zglob library, allowing for
	// globbed matches.
	IncludeDirectories []string `json:"include_directories,omitempty"`

	// ExcludeDirectories are directories which should not have their content censored. If
	// present, content in these directories will not be censored even if the directory also
	// matches a glob in IncludeDirectories. Entries in this list are relative to $ARTIFACTS,
	// and are parsed with the go-zglob library, allowing for globbed matches.
	ExcludeDirectories []string `json:"exclude_directories,omitempty"`
}

func (*CensoringOptions) ApplyDefault

func (g *CensoringOptions) ApplyDefault(def *CensoringOptions) *CensoringOptions

ApplyDefault applies the defaults for CensoringOptions decorations. If a field has a zero value, it replaces that with the value set in def.

func (*CensoringOptions) DeepCopy

func (in *CensoringOptions) DeepCopy() *CensoringOptions

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CensoringOptions.

func (*CensoringOptions) DeepCopyInto

func (in *CensoringOptions) DeepCopyInto(out *CensoringOptions)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DecorationConfig

type DecorationConfig struct {
	// Timeout is how long the pod utilities will wait
	// before aborting a job with SIGINT.
	Timeout *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 *Duration `json:"grace_period,omitempty"`

	// UtilityImages holds pull specs for utility container
	// images used to decorate a PodSpec.
	UtilityImages *UtilityImages `json:"utility_images,omitempty"`
	// Resources holds resource requests and limits for utility
	// containers used to decorate a PodSpec.
	Resources *Resources `json:"resources,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"`
	// S3CredentialsSecret is the name of the Kubernetes secret
	// that holds blob storage push credentials.
	S3CredentialsSecret *string `json:"s3_credentials_secret,omitempty"`
	// DefaultServiceAccountName is the name of the Kubernetes service account
	// that should be used by the pod if one is not specified in the podspec.
	DefaultServiceAccountName *string `json:"default_service_account_name,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"`
	// SSHHostFingerprints are the fingerprints of known SSH hosts
	// that the cloning process can trust.
	// Create with ssh-keyscan [-t rsa] host
	SSHHostFingerprints []string `json:"ssh_host_fingerprints,omitempty"`
	// SkipCloning determines if we should clone source code in the
	// initcontainers for jobs that specify refs
	SkipCloning *bool `json:"skip_cloning,omitempty"`
	// CookieFileSecret is the name of a kubernetes secret that contains
	// a git http.cookiefile, which should be used during the cloning process.
	CookiefileSecret *string `json:"cookiefile_secret,omitempty"`
	// OauthTokenSecret is a Kubernetes secret that contains the OAuth token,
	// which is going to be used for fetching a private repository.
	OauthTokenSecret *OauthTokenSecret `json:"oauth_token_secret,omitempty"`
	// GitHubAPIEndpoints are the endpoints of GitHub APIs.
	GitHubAPIEndpoints []string `json:"github_api_endpoints,omitempty"`
	// GitHubAppID is the ID of GitHub App, which is going to be used for fetching a private
	// repository.
	GitHubAppID string `json:"github_app_id,omitempty"`
	// GitHubAppPrivateKeySecret is a Kubernetes secret that contains the GitHub App private key,
	// which is going to be used for fetching a private repository.
	GitHubAppPrivateKeySecret *GitHubAppPrivateKeySecret `json:"github_app_private_key_secret,omitempty"`

	// CensorSecrets enables censoring output logs and artifacts.
	CensorSecrets *bool `json:"censor_secrets,omitempty"`

	// CensoringOptions exposes options for censoring output logs and artifacts.
	CensoringOptions *CensoringOptions `json:"censoring_options,omitempty"`

	// UploadIgnoresInterrupts causes sidecar to ignore interrupts for the upload process in
	// hope that the test process exits cleanly before starting an upload.
	UploadIgnoresInterrupts *bool `json:"upload_ignores_interrupts,omitempty"`

	// SetLimitEqualsMemoryRequest sets memory limit equal to request.
	SetLimitEqualsMemoryRequest *bool `json:"set_limit_equals_memory_request,omitempty"`
	// DefaultMemoryRequest is the default requested memory on a test container.
	// If SetLimitEqualsMemoryRequest is also true then the Limit will also be
	// set the same as this request. Could be overridden by memory request
	// defined explicitly on prowjob.
	DefaultMemoryRequest *resource.Quantity `json:"default_memory_request,omitempty"`
}

DecorationConfig specifies how to augment pods.

This is primarily used to provide automatic integration with gubernator and testgrid.

func (*DecorationConfig) ApplyDefault

func (d *DecorationConfig) ApplyDefault(def *DecorationConfig) *DecorationConfig

ApplyDefault applies the defaults for the ProwJob decoration. If a field has a zero value, it replaces that with the value set in def.

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.

func (*DecorationConfig) Validate

func (d *DecorationConfig) Validate() error

Validate ensures all the values set in the DecorationConfig are valid.

type Duration

type Duration struct {
	time.Duration
}

Duration is a wrapper around time.Duration that parses times in either 'integer number of nanoseconds' or 'duration string' formats and serializes to 'duration string' format. +kubebuilder:validation:Type=string

func (*Duration) DeepCopy

func (in *Duration) DeepCopy() *Duration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Duration.

func (*Duration) DeepCopyInto

func (in *Duration) DeepCopyInto(out *Duration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Duration) Get

func (d *Duration) Get() time.Duration

func (*Duration) MarshalJSON

func (d *Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type GCSConfiguration

type GCSConfiguration struct {
	// Bucket is the bucket to upload to, it can be:
	// * a GCS bucket: with gs:// prefix
	// * a S3 bucket: with s3:// prefix
	// * a GCS bucket: without a prefix (deprecated, it's discouraged to use Bucket without prefix please add the gs:// prefix)
	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"`
	// MediaTypes holds additional extension media types to add to Go's
	// builtin's and the local system's defaults.  This maps extensions
	// to media types, for example: MediaTypes["log"] = "text/plain"
	MediaTypes map[string]string `json:"mediaTypes,omitempty"`
	// JobURLPrefix holds the baseURL under which the jobs output can be viewed.
	// If unset, this will be derived based on org/repo from the job_url_prefix_config.
	JobURLPrefix string `json:"job_url_prefix,omitempty"`

	// LocalOutputDir specifies a directory where files should be copied INSTEAD of uploading to blob storage.
	// This option is useful for testing jobs that use the pod-utilities without actually uploading.
	LocalOutputDir string `json:"local_output_dir,omitempty"`
}

GCSConfiguration holds options for pushing logs and artifacts to GCS from a job.

func (*GCSConfiguration) ApplyDefault

func (g *GCSConfiguration) ApplyDefault(def *GCSConfiguration) *GCSConfiguration

ApplyDefault applies the defaults for GCSConfiguration decorations. If a field has a zero value, it replaces that with the value set in def.

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.

func (*GCSConfiguration) Validate

func (g *GCSConfiguration) Validate() error

Validate ensures all the values set in the GCSConfiguration are valid.

type GitHubAppPrivateKeySecret

type GitHubAppPrivateKeySecret struct {
	// Name is the name of a kubernetes secret.
	Name string `json:"name,omitempty"`
	// Key is the key of the corresponding kubernetes secret that
	// holds the value of the GitHub App private key.
	Key string `json:"key,omitempty"`
}

GitHubAppPrivateKeySecret holds the information of the GitHub App private key's secret name and key.

func (*GitHubAppPrivateKeySecret) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubAppPrivateKeySecret.

func (*GitHubAppPrivateKeySecret) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GitHubTeamSlug

type GitHubTeamSlug struct {
	Slug string `json:"slug"`
	Org  string `json:"org"`
}

func (*GitHubTeamSlug) DeepCopy

func (in *GitHubTeamSlug) DeepCopy() *GitHubTeamSlug

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubTeamSlug.

func (*GitHubTeamSlug) DeepCopyInto

func (in *GitHubTeamSlug) DeepCopyInto(out *GitHubTeamSlug)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JenkinsSpec

type JenkinsSpec struct {
	GitHubBranchSourceJob bool `json:"github_branch_source_job,omitempty"`
}

JenkinsSpec is optional parameters for Jenkins jobs. Currently, the only parameter supported is for telling jenkins-operator that the job is generated by the https://go.cloudbees.com/docs/plugins/github-branch-source/#github-branch-source plugin

func (*JenkinsSpec) DeepCopy

func (in *JenkinsSpec) DeepCopy() *JenkinsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JenkinsSpec.

func (*JenkinsSpec) DeepCopyInto

func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OauthTokenSecret

type OauthTokenSecret struct {
	// Name is the name of a kubernetes secret.
	Name string `json:"name,omitempty"`
	// Key is the key of the corresponding kubernetes secret that
	// holds the value of the OAuth token.
	Key string `json:"key,omitempty"`
}

OauthTokenSecret holds the information of the oauth token's secret name and key.

func (*OauthTokenSecret) DeepCopy

func (in *OauthTokenSecret) DeepCopy() *OauthTokenSecret

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OauthTokenSecret.

func (*OauthTokenSecret) DeepCopyInto

func (in *OauthTokenSecret) DeepCopyInto(out *OauthTokenSecret)

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. +kubebuilder:printcolumn:name="Job",type=string,JSONPath=`.spec.job`,description="The name of the job being run" +kubebuilder:printcolumn:name="BuildId",type=string,JSONPath=`.status.build_id`,description="The ID of the job being run." +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`,description="The type of job being run." +kubebuilder:printcolumn:name="Org",type=string,JSONPath=`.spec.refs.org`,description="The org for which the job is running." +kubebuilder:printcolumn:name="Repo",type=string,JSONPath=`.spec.refs.repo`,description="The repo for which the job is running." +kubebuilder:printcolumn:name="Pulls",type=string,JSONPath=`.spec.refs.pulls[*].number`,description="The pulls for which the job is running." +kubebuilder:printcolumn:name="StartTime",type=date,JSONPath=`.status.startTime`,description="When the job started running." +kubebuilder:printcolumn:name="CompletionTime",type=date,JSONPath=`.status.completionTime`,description="When the job finished running." +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="The state of the job."

func (*ProwJob) ClusterAlias

func (j *ProwJob) ClusterAlias() string

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) Complete

func (j *ProwJob) Complete() bool

Complete returns true if the prow job has finished

func (*ProwJob) DeepCopy

func (in *ProwJob) DeepCopy() *ProwJob

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwJob.

func (*ProwJob) DeepCopyInto

func (in *ProwJob) DeepCopyInto(out *ProwJob)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ProwJob) DeepCopyObject

func (in *ProwJob) DeepCopyObject() runtime.Object

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.

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 ProwJobAgent = "jenkins"
	// TektonAgent means prow will schedule the job via a tekton PipelineRun CRD resource.
	TektonAgent = "tekton-pipeline"
)

type ProwJobDefault

type ProwJobDefault struct {
	TenantID string `json:"tenant_id,omitempty"`
}

ProwJobDefault is used for Prowjob fields we want to set as defaults in Prow config

func (*ProwJobDefault) ApplyDefault

func (d *ProwJobDefault) ApplyDefault(def *ProwJobDefault) *ProwJobDefault

func (*ProwJobDefault) DeepCopy

func (in *ProwJobDefault) DeepCopy() *ProwJobDefault

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwJobDefault.

func (*ProwJobDefault) DeepCopyInto

func (in *ProwJobDefault) DeepCopyInto(out *ProwJobDefault)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ProwJobList

type ProwJobList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []ProwJob `json:"items"`
}

ProwJobList is a list of ProwJob 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
	// +kubebuilder:validation:Enum=presubmit;postsubmit;periodic;batch
	// +kubebuilder:validation:Required
	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"`
	// Namespace defines where to create pods/resources.
	Namespace string `json:"namespace,omitempty"`
	// Job is the name of the job
	// +kubebuilder:validation:Required
	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 reported (e.g. status on GitHub, message in Slack, etc.)
	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. This is
	// a separate mechanism to JobQueueName and the lowest max
	// concurrency is selected from these two.
	// +kubebuilder:validation:Minimum=0
	MaxConcurrency int `json:"max_concurrency,omitempty"`
	// ErrorOnEviction indicates that the ProwJob should be completed and given
	// the ErrorState status if the pod that is executing the job is evicted.
	// If this field is unspecified or false, a new pod will be created to replace
	// the evicted one.
	ErrorOnEviction bool `json:"error_on_eviction,omitempty"`

	// PodSpec provides the basis for running the test under
	// a Kubernetes agent
	PodSpec *corev1.PodSpec `json:"pod_spec,omitempty"`

	// JenkinsSpec holds configuration specific to Jenkins jobs
	JenkinsSpec *JenkinsSpec `json:"jenkins_spec,omitempty"`

	// PipelineRunSpec provides the basis for running the test as
	// a pipeline-crd resource
	// https://github.com/tektoncd/pipeline
	PipelineRunSpec *pipelinev1alpha1.PipelineRunSpec `json:"pipeline_run_spec,omitempty"`

	// TektonPipelineRunSpec provides the basis for running the test as
	// a pipeline-crd resource
	// https://github.com/tektoncd/pipeline
	TektonPipelineRunSpec *TektonPipelineRunSpec `json:"tekton_pipeline_run_spec,omitempty"`

	// DecorationConfig holds configuration options for
	// decorating PodSpecs that users provide
	DecorationConfig *DecorationConfig `json:"decoration_config,omitempty"`

	// ReporterConfig holds reporter-specific configuration
	ReporterConfig *ReporterConfig `json:"reporter_config,omitempty"`

	// RerunAuthConfig holds information about which users can rerun the job
	RerunAuthConfig *RerunAuthConfig `json:"rerun_auth_config,omitempty"`

	// Hidden specifies if the Job is considered hidden.
	// Hidden jobs are only shown by deck instances that have the
	// `--hiddenOnly=true` or `--show-hidden=true` flag set.
	// Presubmits and Postsubmits can also be set to hidden by
	// adding their repository in Decks `hidden_repo` setting.
	Hidden bool `json:"hidden,omitempty"`

	// ProwJobDefault holds configuration options provided as defaults
	// in the Prow config
	ProwJobDefault *ProwJobDefault `json:"prowjob_defaults,omitempty"`

	// JobQueueName is an optional field with name of a queue defining
	// max concurrency. When several jobs from the same queue try to run
	// at the same time, the number of them that is actually started is
	// limited by JobQueueCapacities (part of Plank's config). If
	// this field is left undefined inifinite concurrency is assumed.
	// This behaviour may be superseded by MaxConcurrency field, if it
	// is set to a constraining value.
	JobQueueName string `json:"job_queue_name,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.

func (ProwJobSpec) GetPipelineRunSpec

func (pjs ProwJobSpec) GetPipelineRunSpec() (*pipelinev1beta1.PipelineRunSpec, error)

func (ProwJobSpec) HasPipelineRunSpec

func (pjs ProwJobSpec) HasPipelineRunSpec() bool

type ProwJobState

type ProwJobState string

ProwJobState specifies whether the job is running

const (
	// TriggeredState means the job has been created but not yet scheduled.
	TriggeredState ProwJobState = "triggered"
	// PendingState means the job is currently running and we are waiting for it to finish.
	PendingState ProwJobState = "pending"
	// SuccessState means the job completed without error (exit 0)
	SuccessState ProwJobState = "success"
	// FailureState means the job completed with errors (exit non-zero)
	FailureState ProwJobState = "failure"
	// AbortedState means prow killed the job early (new commit pushed, perhaps).
	AbortedState ProwJobState = "aborted"
	// ErrorState means the job could not schedule (bad config, perhaps).
	ErrorState ProwJobState = "error"
)

Various job states.

func GetAllProwJobStates

func GetAllProwJobStates() []ProwJobState

GetAllProwJobStates returns all possible job states.

type ProwJobStatus

type ProwJobStatus struct {
	// StartTime is equal to the creation time of the ProwJob
	StartTime metav1.Time `json:"startTime,omitempty"`
	// PendingTime is the timestamp for when the job moved from triggered to pending
	PendingTime *metav1.Time `json:"pendingTime,omitempty"`
	// CompletionTime is the timestamp for when the job goes to a final state
	CompletionTime *metav1.Time `json:"completionTime,omitempty"`
	// +kubebuilder:validation:Enum=triggered;pending;success;failure;aborted;error
	// +kubebuilder:validation:Required
	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"`

	// PrevReportStates stores the previous reported prowjob state per reporter
	// So crier won't make duplicated report attempt
	PrevReportStates map[string]ProwJobState `json:"prev_report_states,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 ProwJobType

type ProwJobType string

ProwJobType specifies how the job is triggered.

const (
	// PresubmitJob means it runs on unmerged PRs.
	PresubmitJob ProwJobType = "presubmit"
	// PostsubmitJob means it runs on each new commit.
	PostsubmitJob ProwJobType = "postsubmit"
	// Periodic job means it runs on a time-basis, unrelated to git changes.
	PeriodicJob ProwJobType = "periodic"
	// BatchJob tests multiple unmerged PRs at the same time.
	BatchJob ProwJobType = "batch"
)

Various job types.

type ProwPath

type ProwPath url.URL

func ParsePath

func ParsePath(bucket string) (*ProwPath, error)

ParsePath tries to extract the ProwPath from, e.g.: * <bucket-name> (storageProvider gs) * <storage-provider>://<bucket-name>

func (ProwPath) Bucket

func (pp ProwPath) Bucket() string

func (*ProwPath) DeepCopy

func (in *ProwPath) DeepCopy() *ProwPath

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProwPath.

func (*ProwPath) DeepCopyInto

func (in *ProwPath) DeepCopyInto(out *ProwPath)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (ProwPath) FullPath

func (pp ProwPath) FullPath() string

func (ProwPath) StorageProvider

func (pp ProwPath) StorageProvider() string

type Pull

type Pull struct {
	Number int    `json:"number"`
	Author string `json:"author"`
	SHA    string `json:"sha"`
	Title  string `json:"title,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"`
	// HeadRef is the git ref (branch name) of the proposed change.  This can be more human-readable than just
	// a PR #, and some tools want this metadata to help associate the work with a pull request (e.g. some code
	// scanning services, or chromatic.com).
	HeadRef string `json:"head_ref,omitempty"`
	// Link links to the pull request itself.
	Link string `json:"link,omitempty"`
	// CommitLink links to the commit identified by the SHA.
	CommitLink string `json:"commit_link,omitempty"`
	// AuthorLink links to the author of the pull request.
	AuthorLink string `json:"author_link,omitempty"`
}

Pull describes a pull request at a particular point in time.

func (*Pull) DeepCopy

func (in *Pull) DeepCopy() *Pull

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pull.

func (*Pull) DeepCopyInto

func (in *Pull) DeepCopyInto(out *Pull)

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"`
	// Repo is something like test-infra
	Repo string `json:"repo"`
	// RepoLink links to the source for Repo.
	RepoLink string `json:"repo_link,omitempty"`

	BaseRef string `json:"base_ref,omitempty"`
	BaseSHA string `json:"base_sha,omitempty"`
	// BaseLink is a link to the commit identified by BaseSHA.
	BaseLink string `json:"base_link,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"`

	// WorkDir defines if the location of the cloned
	// repository will be used as the default working
	// directory.
	WorkDir bool `json:"workdir,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"`
	// SkipSubmodules determines if submodules should be
	// cloned when the job is run. Defaults to false.
	SkipSubmodules bool `json:"skip_submodules,omitempty"`
	// CloneDepth is the depth of the clone that will be used.
	// A depth of zero will do a full clone.
	CloneDepth int `json:"clone_depth,omitempty"`
	// SkipFetchHead tells prow to avoid a git fetch <remote> call.
	// Multiheaded repos may need to not make this call.
	// The git fetch <remote> <BaseRef> call occurs regardless.
	SkipFetchHead bool `json:"skip_fetch_head,omitempty"`
}

Refs describes how the repo was constructed.

func (*Refs) DeepCopy

func (in *Refs) DeepCopy() *Refs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Refs.

func (*Refs) DeepCopyInto

func (in *Refs) DeepCopyInto(out *Refs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Refs) OrgRepoString

func (r Refs) OrgRepoString() string

func (Refs) String

func (r Refs) String() string

type ReporterConfig

type ReporterConfig struct {
	Slack *SlackReporterConfig `json:"slack,omitempty"`
}

func (*ReporterConfig) DeepCopy

func (in *ReporterConfig) DeepCopy() *ReporterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReporterConfig.

func (*ReporterConfig) DeepCopyInto

func (in *ReporterConfig) DeepCopyInto(out *ReporterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RerunAuthConfig

type RerunAuthConfig struct {
	// If AllowAnyone is set to true, any user can rerun the job
	AllowAnyone bool `json:"allow_anyone,omitempty"`
	// GitHubTeams contains IDs of GitHub teams of users who can rerun the job
	// If you know the name of a team and the org it belongs to,
	// you can look up its ID using this command, where the team slug is the hyphenated name:
	// curl -H "Authorization: token <token>" "https://api.github.com/orgs/<org-name>/teams/<team slug>"
	// or, to list all teams in a given org, use
	// curl -H "Authorization: token <token>" "https://api.github.com/orgs/<org-name>/teams"
	GitHubTeamIDs []int `json:"github_team_ids,omitempty"`
	// GitHubTeamSlugs contains slugs and orgs of teams of users who can rerun the job
	GitHubTeamSlugs []GitHubTeamSlug `json:"github_team_slugs,omitempty"`
	// GitHubUsers contains names of individual users who can rerun the job
	GitHubUsers []string `json:"github_users,omitempty"`
	// GitHubOrgs contains names of GitHub organizations whose members can rerun the job
	GitHubOrgs []string `json:"github_orgs,omitempty"`
}

func (*RerunAuthConfig) DeepCopy

func (in *RerunAuthConfig) DeepCopy() *RerunAuthConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RerunAuthConfig.

func (*RerunAuthConfig) DeepCopyInto

func (in *RerunAuthConfig) DeepCopyInto(out *RerunAuthConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RerunAuthConfig) IsAllowAnyone

func (rac *RerunAuthConfig) IsAllowAnyone() bool

IsAllowAnyone checks if anyone can rerun the job.

func (*RerunAuthConfig) IsAuthorized

func (rac *RerunAuthConfig) IsAuthorized(org, user string, cli prowgithub.RerunClient) (bool, error)

IsSpecifiedUser returns true if AllowAnyone is set to true or if the given user is specified as a permitted GitHubUser

func (*RerunAuthConfig) Validate

func (rac *RerunAuthConfig) Validate() error

Validate validates the RerunAuthConfig fields.

type Resources

type Resources struct {
	CloneRefs       *corev1.ResourceRequirements `json:"clonerefs,omitempty"`
	InitUpload      *corev1.ResourceRequirements `json:"initupload,omitempty"`
	PlaceEntrypoint *corev1.ResourceRequirements `json:"place_entrypoint,omitempty"`
	Sidecar         *corev1.ResourceRequirements `json:"sidecar,omitempty"`
}

Resources holds resource requests and limits for containers used to decorate a PodSpec

func (*Resources) ApplyDefault

func (u *Resources) ApplyDefault(def *Resources) *Resources

ApplyDefault applies the defaults for the resource decorations. If a field has a zero value, it replaces that with the value set in def.

func (*Resources) DeepCopy

func (in *Resources) DeepCopy() *Resources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.

func (*Resources) DeepCopyInto

func (in *Resources) DeepCopyInto(out *Resources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SlackReporterConfig

type SlackReporterConfig struct {
	Host              string         `json:"host,omitempty"`
	Channel           string         `json:"channel,omitempty"`
	JobStatesToReport []ProwJobState `json:"job_states_to_report,omitempty"`
	ReportTemplate    string         `json:"report_template,omitempty"`
	// Report is derived from JobStatesToReport, it's used for differentiating
	// nil from empty slice, as yaml roundtrip by design can't tell the
	// difference when omitempty is supplied.
	// See https://github.com/kubernetes/test-infra/pull/24168 for details
	// Priority-wise, it goes by following order:
	// - `report: true/false“ in job config
	// - `JobStatesToReport: <anything including empty slice>` in job config
	// - `report: true/false“ in global config
	// - `JobStatesToReport:` in global config
	Report *bool `json:"report,omitempty"`
}

func (*SlackReporterConfig) ApplyDefault

ApplyDefault is called by jobConfig.ApplyDefault(globalConfig)

func (*SlackReporterConfig) DeepCopy

func (in *SlackReporterConfig) DeepCopy() *SlackReporterConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackReporterConfig.

func (*SlackReporterConfig) DeepCopyInto

func (in *SlackReporterConfig) DeepCopyInto(out *SlackReporterConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TektonPipelineRunSpec

type TektonPipelineRunSpec struct {
	V1Beta1 *pipelinev1beta1.PipelineRunSpec `json:"v1beta1,omitempty"`
}

TektonPipelineRunSpec is optional parameters for Tekton pipeline jobs.

func (*TektonPipelineRunSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TektonPipelineRunSpec.

func (*TektonPipelineRunSpec) DeepCopyInto

func (in *TektonPipelineRunSpec) DeepCopyInto(out *TektonPipelineRunSpec)

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) ApplyDefault

func (u *UtilityImages) ApplyDefault(def *UtilityImages) *UtilityImages

ApplyDefault applies the defaults for the UtilityImages decorations. If a field has a zero value, it replaces that with the value set in def.

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.

Jump to

Keyboard shortcuts

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