1 package v1 2 3 // annotations 4 const ( 5 // BuildAnnotation is an annotation that identifies a Pod as being for a Build 6 BuildAnnotation = "openshift.io/build.name" 7 8 // BuildConfigAnnotation is an annotation that identifies the BuildConfig that a Build was created from 9 BuildConfigAnnotation = "openshift.io/build-config.name" 10 11 // BuildCloneAnnotation is an annotation whose value is the name of the build this build was cloned from 12 BuildCloneAnnotation = "openshift.io/build.clone-of" 13 14 // BuildNumberAnnotation is an annotation whose value is the sequential number for this Build 15 BuildNumberAnnotation = "openshift.io/build.number" 16 17 // BuildPodNameAnnotation is an annotation whose value is the name of the pod running this build 18 BuildPodNameAnnotation = "openshift.io/build.pod-name" 19 20 // BuildJenkinsStatusJSONAnnotation is an annotation holding the Jenkins status information 21 BuildJenkinsStatusJSONAnnotation = "openshift.io/jenkins-status-json" 22 23 // BuildJenkinsLogURLAnnotation is an annotation holding a link to the raw Jenkins build console log 24 BuildJenkinsLogURLAnnotation = "openshift.io/jenkins-log-url" 25 26 // BuildJenkinsConsoleLogURLAnnotation is an annotation holding a link to the Jenkins build console log (including Jenkins chrome wrappering) 27 BuildJenkinsConsoleLogURLAnnotation = "openshift.io/jenkins-console-log-url" 28 29 // BuildJenkinsBlueOceanLogURLAnnotation is an annotation holding a link to the Jenkins build console log via the Jenkins BlueOcean UI Plugin 30 BuildJenkinsBlueOceanLogURLAnnotation = "openshift.io/jenkins-blueocean-log-url" 31 32 // BuildJenkinsBuildURIAnnotation is an annotation holding a link to the Jenkins build 33 BuildJenkinsBuildURIAnnotation = "openshift.io/jenkins-build-uri" 34 35 // BuildSourceSecretMatchURIAnnotationPrefix is a prefix for annotations on a Secret which indicate a source URI against which the Secret can be used 36 BuildSourceSecretMatchURIAnnotationPrefix = "build.openshift.io/source-secret-match-uri-" 37 38 // BuildConfigPausedAnnotation is an annotation that marks a BuildConfig as paused. 39 // New Builds cannot be instantiated from a paused BuildConfig. 40 BuildConfigPausedAnnotation = "openshift.io/build-config.paused" 41 ) 42 43 // labels 44 const ( 45 // BuildConfigLabel is the key of a Build label whose value is the ID of a BuildConfig 46 // on which the Build is based. NOTE: The value for this label may not contain the entire 47 // BuildConfig name because it will be truncated to maximum label length. 48 BuildConfigLabel = "openshift.io/build-config.name" 49 50 // BuildLabel is the key of a Pod label whose value is the Name of a Build which is run. 51 // NOTE: The value for this label may not contain the entire Build name because it will be 52 // truncated to maximum label length. 53 BuildLabel = "openshift.io/build.name" 54 55 // BuildRunPolicyLabel represents the start policy used to start the build. 56 BuildRunPolicyLabel = "openshift.io/build.start-policy" 57 58 // BuildConfigLabelDeprecated was used as BuildConfigLabel before adding namespaces. 59 // We keep it for backward compatibility. 60 BuildConfigLabelDeprecated = "buildconfig" 61 ) 62 63 const ( 64 // StatusReasonError is a generic reason for a build error condition. 65 StatusReasonError StatusReason = "Error" 66 67 // StatusReasonCannotCreateBuildPodSpec is an error condition when the build 68 // strategy cannot create a build pod spec. 69 StatusReasonCannotCreateBuildPodSpec StatusReason = "CannotCreateBuildPodSpec" 70 71 // StatusReasonCannotCreateBuildPod is an error condition when a build pod 72 // cannot be created. 73 StatusReasonCannotCreateBuildPod StatusReason = "CannotCreateBuildPod" 74 75 // StatusReasonInvalidOutputReference is an error condition when the build 76 // output is an invalid reference. 77 StatusReasonInvalidOutputReference StatusReason = "InvalidOutputReference" 78 79 // StatusReasonInvalidImageReference is an error condition when the build 80 // references an invalid image. 81 StatusReasonInvalidImageReference StatusReason = "InvalidImageReference" 82 83 // StatusReasonCancelBuildFailed is an error condition when cancelling a build 84 // fails. 85 StatusReasonCancelBuildFailed StatusReason = "CancelBuildFailed" 86 87 // StatusReasonBuildPodDeleted is an error condition when the build pod is 88 // deleted before build completion. 89 StatusReasonBuildPodDeleted StatusReason = "BuildPodDeleted" 90 91 // StatusReasonExceededRetryTimeout is an error condition when the build has 92 // not completed and retrying the build times out. 93 StatusReasonExceededRetryTimeout StatusReason = "ExceededRetryTimeout" 94 95 // StatusReasonMissingPushSecret indicates that the build is missing required 96 // secret for pushing the output image. 97 // The build will stay in the pending state until the secret is created, or the build times out. 98 StatusReasonMissingPushSecret StatusReason = "MissingPushSecret" 99 100 // StatusReasonPostCommitHookFailed indicates the post-commit hook failed. 101 StatusReasonPostCommitHookFailed StatusReason = "PostCommitHookFailed" 102 103 // StatusReasonPushImageToRegistryFailed indicates that an image failed to be 104 // pushed to the registry. 105 StatusReasonPushImageToRegistryFailed StatusReason = "PushImageToRegistryFailed" 106 107 // StatusReasonPullBuilderImageFailed indicates that we failed to pull the 108 // builder image. 109 StatusReasonPullBuilderImageFailed StatusReason = "PullBuilderImageFailed" 110 111 // StatusReasonFetchSourceFailed indicates that fetching the source of the 112 // build has failed. 113 StatusReasonFetchSourceFailed StatusReason = "FetchSourceFailed" 114 115 // StatusReasonFetchImageContentFailed indicates that the fetching of an image and extracting 116 // its contents for inclusion in the build has failed. 117 StatusReasonFetchImageContentFailed StatusReason = "FetchImageContentFailed" 118 119 // StatusReasonManageDockerfileFailed indicates that the set up of the Dockerfile for the build 120 // has failed. 121 StatusReasonManageDockerfileFailed StatusReason = "ManageDockerfileFailed" 122 123 // StatusReasonInvalidContextDirectory indicates that the supplied 124 // contextDir does not exist 125 StatusReasonInvalidContextDirectory StatusReason = "InvalidContextDirectory" 126 127 // StatusReasonCancelledBuild indicates that the build was cancelled by the 128 // user. 129 StatusReasonCancelledBuild StatusReason = "CancelledBuild" 130 131 // StatusReasonDockerBuildFailed indicates that the container image build strategy has 132 // failed. 133 StatusReasonDockerBuildFailed StatusReason = "DockerBuildFailed" 134 135 // StatusReasonBuildPodExists indicates that the build tried to create a 136 // build pod but one was already present. 137 StatusReasonBuildPodExists StatusReason = "BuildPodExists" 138 139 // StatusReasonNoBuildContainerStatus indicates that the build failed because the 140 // the build pod has no container statuses. 141 StatusReasonNoBuildContainerStatus StatusReason = "NoBuildContainerStatus" 142 143 // StatusReasonFailedContainer indicates that the pod for the build has at least 144 // one container with a non-zero exit status. 145 StatusReasonFailedContainer StatusReason = "FailedContainer" 146 147 // StatusReasonUnresolvableEnvironmentVariable indicates that an error occurred processing 148 // the supplied options for environment variables in the build strategy environment 149 StatusReasonUnresolvableEnvironmentVariable StatusReason = "UnresolvableEnvironmentVariable" 150 151 // StatusReasonGenericBuildFailed is the reason associated with a broad 152 // range of build failures. 153 StatusReasonGenericBuildFailed StatusReason = "GenericBuildFailed" 154 155 // StatusReasonOutOfMemoryKilled indicates that the build pod was killed for its memory consumption 156 StatusReasonOutOfMemoryKilled StatusReason = "OutOfMemoryKilled" 157 158 // StatusReasonCannotRetrieveServiceAccount is the reason associated with a failure 159 // to look up the service account associated with the BuildConfig. 160 StatusReasonCannotRetrieveServiceAccount StatusReason = "CannotRetrieveServiceAccount" 161 162 // StatusReasonBuildPodEvicted is the reason a build fails due to the build pod being evicted 163 // from its node 164 StatusReasonBuildPodEvicted StatusReason = "BuildPodEvicted" 165 ) 166 167 // env vars 168 // WhitelistEnvVarNames is a list of special env vars allows s2i containers 169 var WhitelistEnvVarNames = []string{"BUILD_LOGLEVEL", "GIT_SSL_NO_VERIFY", "HTTP_PROXY", "HTTPS_PROXY", "LANG", "NO_PROXY"} 170 171 // env vars 172 const ( 173 174 // CustomBuildStrategyBaseImageKey is the environment variable that indicates the base image to be used when 175 // performing a custom build, if needed. 176 CustomBuildStrategyBaseImageKey = "OPENSHIFT_CUSTOM_BUILD_BASE_IMAGE" 177 178 // AllowedUIDs is an environment variable that contains ranges of UIDs that are allowed in 179 // Source builder images 180 AllowedUIDs = "ALLOWED_UIDS" 181 // DropCapabilities is an environment variable that contains a list of capabilities to drop when 182 // executing a Source build 183 DropCapabilities = "DROP_CAPS" 184 ) 185 186 // keys inside of secrets and configmaps 187 const ( 188 // WebHookSecretKey is the key used to identify the value containing the webhook invocation 189 // secret within a secret referenced by a webhook trigger. 190 WebHookSecretKey = "WebHookSecretKey" 191 192 // RegistryConfKey is the ConfigMap key for the build pod's registry configuration file. 193 RegistryConfKey = "registries.conf" 194 195 // SignaturePolicyKey is the ConfigMap key for the build pod's image signature policy file. 196 SignaturePolicyKey = "policy.json" 197 198 // ServiceCAKey is the ConfigMap key for the service signing certificate authority mounted into build pods. 199 ServiceCAKey = "service-ca.crt" 200 ) 201