sigs.k8s.io/prow@v0.0.0-20240503223140-c5e374dc7eb1/pkg/kube/prowjob.go (about) 1 /* 2 Copyright 2018 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package kube 18 19 const ( 20 // CreatedByProw is added on resources created by prow. 21 // Since resources often live in another cluster/namespace, 22 // the k8s garbage collector would immediately delete these 23 // resources 24 // TODO: Namespace this label. 25 CreatedByProw = "created-by-prow" 26 // CreatedByTideLabel is added by tide when it triggered a job. 27 // TODO: Namespace this label. 28 CreatedByTideLabel = "created-by-tide" 29 // ProwJobTypeLabel is added in resources created by prow and 30 // carries the job type (presubmit, postsubmit, periodic, batch) 31 // that the pod is running. 32 ProwJobTypeLabel = "prow.k8s.io/type" 33 // ProwJobIDLabel is added in resources created by prow and 34 // carries the ID of the ProwJob that the pod is fulfilling. 35 // We also name resources after the ProwJob that spawned them but 36 // this allows for multiple resources to be linked to one 37 // ProwJob. 38 ProwJobIDLabel = "prow.k8s.io/id" 39 // ProwBuildIDLabel is added in resources created by prow and 40 // carries the BuildID from a Prow Job's Status. 41 ProwBuildIDLabel = "prow.k8s.io/build-id" 42 // ProwJobAnnotation is added in resources created by prow and 43 // carries the name of the job that the pod is running. Since 44 // job names can be arbitrarily long, this is added as 45 // an annotation instead of a label. 46 ProwJobAnnotation = "prow.k8s.io/job" 47 // ContextAnnotation is added in resources created by prow and 48 // carries the context of the job that the pod is running. Since 49 // job names can be arbitrarily long, this is added as 50 // an annotation instead of a label. 51 ContextAnnotation = "prow.k8s.io/context" 52 // PlankVersionLabel is added in resources created by prow and 53 // carries the version of prow that decorated this job. 54 PlankVersionLabel = "prow.k8s.io/plank-version" 55 // OrgLabel is added in resources created by prow and 56 // carries the org associated with the job, eg kubernetes-sigs. 57 OrgLabel = "prow.k8s.io/refs.org" 58 // RepoLabel is added in resources created by prow and 59 // carries the repo associated with the job, eg test-infra 60 RepoLabel = "prow.k8s.io/refs.repo" 61 // BaseRefLabel is added in resources created by prow and 62 // carries the base ref associated with the job, eg main 63 BaseRefLabel = "prow.k8s.io/refs.base_ref" 64 // PullLabel is added in resources created by prow and 65 // carries the PR number associated with the job, eg 321. 66 PullLabel = "prow.k8s.io/refs.pull" 67 // RetestLabel exposes if the job was created by a re-test request. 68 RetestLabel = "prow.k8s.io/retest" 69 // IsOptionalLabel is added in resources created by prow and 70 // carries the Optional from a Presubmit job. 71 IsOptionalLabel = "prow.k8s.io/is-optional" 72 73 // Gerrit related labels that are used by Prow 74 75 // GerritID identifies a gerrit change 76 GerritID = "prow.k8s.io/gerrit-id" 77 // GerritInstance is the gerrit host url 78 GerritInstance = "prow.k8s.io/gerrit-instance" 79 // GerritRevision is the SHA of current patchset from a gerrit change 80 GerritRevision = "prow.k8s.io/gerrit-revision" 81 // GerritPatchset is the numeric ID of the current patchset 82 GerritPatchset = "prow.k8s.io/gerrit-patchset" 83 // GerritReportLabel is the gerrit label prow will cast vote on, fallback to CodeReview label if unset 84 GerritReportLabel = "prow.k8s.io/gerrit-report-label" 85 )