Configure
Configuring Builds
Abstract
Chapter 1. Configuring Builds Copy linkLink copied to clipboard!
In a Build custom resource (CR), you can define the source, build strategy, parameter values, output, retention parameters, and volumes to configure a build. A Build resource is available for use within a namespace.
For configuring a build, create a Build resource YAML file and apply it to the OpenShift Container Platform cluster.
1.1. Configurable fields in build Copy linkLink copied to clipboard!
You can use the following fields in your Build custom resource (CR):
| Field | Presence | Description |
|---|---|---|
|
| Required |
Specifies the API version of the resource, for example, |
|
| Required |
Specifies the type of the resource, for example, |
|
| Required |
Denotes the metadata that identifies the custom resource definition instance, for example, the name of the |
|
| Required | Denotes the location of the source code, for example, a Git repository or source bundle image. |
|
| Required |
Denotes the name and type of the strategy used for the |
|
| Required | Denotes the location where the generated image will be pushed. |
|
| Required | Denotes an existing secret to get access to the container registry. |
|
| Optional | Denotes a name-value list to specify values for parameters defined in the build strategy. |
|
| Optional |
Defines a custom timeout. The default value is ten minutes. You can overwrite this field value in your |
|
| Optional | Denotes a list of key-value pair that you can use to annotate the output image. |
|
| Optional | Denotes a list of key-value pair that you can use to label the output image. |
|
| Optional | Defines additional environment variables that you can pass to the build container. The available variables depend on the tool that is used by your build strategy. |
|
| Optional | Specifies the duration for which a failed build run can exist. |
|
| Optional | Specifies the duration for which a successful build run can exist. |
|
| Optional | Specifies the number of failed build runs that can exist. |
|
| Optional | Specifies the number of successful build runs that can exist. |
1.2. Source definition Copy linkLink copied to clipboard!
You can configure the source details for a build in the Build custom resource (CR) by setting the value of the following fields:
-
source.git.url: Defines the source location of the image available in a Git repository. -
source.git.cloneSecret: References a secret in the namespace that contains the SSH private key for a private Git repository. -
source.git.revision: Defines a specific revision to select from the source Git repository. For example, a commit, tag, or branch name. This field defaults to the Git repository default branch. -
source.contextDir: Specifies the context path for the repositories where the source code is not present at the root folder.
The build controller does not automatically validate that the Git repository you specified for pulling an image exists. If you need to validate, set the value of the build.shipwright.io/verify.repository annotation to true, as shown in the following example:
The build controller validates the existence of a Git repository in the following scenarios:
- When you use the endpoint URL with an HTTP or HTTPS protocol.
-
When you have defined an SSH protocol, such as
git@, but not a referenced secret, such assource.git.cloneSecret.
The following examples show how you can configure a build with different set of source inputs.
Example: Configuring a build with credentials
You can configure a build with a source by specifying your credentials, as shown in the following example:
Example: Configuring a build with a context path
You can configure a build with a source that specifies a context path in the Git repository, as shown in the following example:
Example: Configuring a build with a tag
You can configure a build with a source that specifies the tag v.0.1.0 for the Git repository, as shown in the following example:
Example: Configuring a build with environment variables
You can also configure a build that specifies environment variables, as shown in the following example:
1.3. Strategy definition Copy linkLink copied to clipboard!
You can configure the strategy for a build in the Build CR. The following build strategies are available for use:
-
buildah -
source-to-image
To configure a build strategy, define the spec.strategy.name and spec.strategy.kind fields in the Build CR, as shown in the following example:
1.4. Parameter values definition for a build Copy linkLink copied to clipboard!
You can specify values for the build strategy parameters in your Build CR. By specifying parameter values, you can control how the steps of the build strategy work. You can also overwrite the values in the BuildRun resource.
For all parameters, you must specify values either directly or by using reference keys from config maps or secrets.
The usage of the parameter in the build strategy steps limits the usage of config maps and secrets. You can only use config maps and secrets if the parameter is used in the command, argument, or environment variable.
When using the paramValues field in your Build CR, avoid the following scenarios:
-
Specifying a
spec.paramValuesname that does not match one of thespec.parametersdefined in theBuildStrategyCR. -
Specifying a
spec.paramValuesname that collides with the Shipwright reserved parameters. These parameters includeBUILDER_IMAGE,CONTEXT_DIR, and any name starting withshp-.
Also, ensure that you understand the content of your strategy before defining the paramValues field in the Build CR.
1.4.1. Example configuration for defining parameter values Copy linkLink copied to clipboard!
The following examples show how to define parameters in a build strategy and assign values to those parameters by using a Build CR. You can also assign a value to a parameter of the type array in your Build CR.
Example: Defining parameters in a ClusterBuildStrategy CR
The following example shows a ClusterBuildStrategy CR that defines several parameters:
Example: Assigning values to parameters in a Build CR
The above ClusterBuildStrategy CR defines a storage-driver parameter and you can specify the value of the storage-driver parameter in your Build CR, as shown in the following example:
Example: Creating a ConfigMap CR to control a parameter centrally
If you want to use the storage-driver parameter for multiple builds and control its usage centrally, then you can create a ConfigMap CR, as shown in the following example:
You can use the created ConfigMap CR as a parameter value in your Build CR, as shown in the following example:
Example: Assigning value to a parameter of the type array in a Build CR
You can assign value to a parameter of the type array. If you use the buildah strategy, you can define a registries-search parameter to search images in specific registries. The following example shows how you can assign a value to the registries-search array parameter:
Example: Referencing a secret in a Build CR
You can reference a secret for a registries-block array parameter, as shown in the following example:
- 1
- The value references a secret.
1.5. Builder or docker file definition Copy linkLink copied to clipboard!
In your Build CR, you can use the spec.paramValues field to specify the image that contains the tools to build the output image. The following example specifies a Dockerfile image in a Build CR:
You can also use a builder image as part of the source-to-image build strategy in your Build CR, as shown in the following example:
1.6. Output definition Copy linkLink copied to clipboard!
In your Build CR, you can specify an output location to push the image. When using an external private registry as your output location, you must specify a secret to access the image. You can also specify the annotations and labels for the output image.
When you specify annotations or labels, the output image is pushed twice. The first push comes from the build strategy and the second push changes the image configuration to add the annotations and labels.
The following example defines a public registry where the image is pushed:
The following example defines a private registry where the image is pushed:
The following example defines annotations and labels for the image:
1.7. Retention parameters definition for a build Copy linkLink copied to clipboard!
You can define retention parameters for the following purposes:
- To specify how long a completed build run can exist
- To specify the number of succeeded or failed build runs that can exist for a build
Retention parameters provide a way to clean your BuildRun instances or resources automatically. You can set the value of the following retention parameters in your Build CR:
-
retention.succeededLimit: Defines the number of succeeded build runs that can exist for a build. -
retention.failedLimit: Defines the number of failed build runs that can exist for a build. -
retention.ttlAfterFailed: Specifies the duration for which a failed build run can exist. -
retention.ttlAfterSucceeded: Specifies the duration for which a successful build run can exist.
The following example shows the usage of retention parameters in a Build CR:
When you change the value of the retention.failedLimit and retention.succeededLimit parameters, the new limit is enforced as soon as those changes are applied on your build. However, when you change the value of the retention.ttlAfterFailed and retention.ttlAfterSucceeded parameters, the new retention duration is enforced only on the new build runs. Old build runs adhere to the old retention duration. If you have defined retention duration in both BuildRun and Build CRs, the retention duration defined in the BuildRun CR gets the priority.
1.8. Volumes definition for a build Copy linkLink copied to clipboard!
You can define volumes in your Build CR. The defined volumes override the volumes specified in the BuildStrategy resource. If a volume is not overridden, then the build run fails.
The following example shows the usage of the volumes field in a Build CR:
Chapter 2. Configuring build strategies Copy linkLink copied to clipboard!
In a BuildStrategy or ClusterBuildStrategy custom resource (CR), you can define strategy parameters, system parameters, step resources definitions, annotations, and volumes to configure a build strategy. A BuildStrategy resource is available for use within a namespace, and a ClusterBuildStrategy resource is available for use throughout the cluster.
To configure a build strategy, create a BuildStrategy or ClusterBuildStrategy resource YAML file and apply it to the OpenShift Container Platform cluster.
2.1. Strategy parameters definition Copy linkLink copied to clipboard!
You can define strategy parameters in a BuildStrategy or ClusterBuildStrategy custom resource (CR) and set, or modify, the values of those parameters in your Build or BuildRun CR. You can also configure or modify strategy parameters at build time when creating your build strategy.
Consider the following points before defining parameters for your strategy:
-
Define a list of parameters in the
spec.parametersfield of your build strategy CR. Each list item contains a name, a description, a type, and an optional default value, or values, for an array type. If no default value is set, you must define a value in theBuildorBuildRunCR. -
Define parameters of string or array type in the
spec.stepsfield of your build strategy. Specify a parameter of string type by using the
$(params.your-parameter-name)syntax. You can set a value for theyour-parameter-nameparameter in yourBuildorBuildRunCR that references your strategy. You can define the following string parameters based on your needs:Expand Table 2.1. String parameters Parameter Description imageUse this parameter to define a custom tag, such as
golang:$(params.go-version)argsUse this parameter to pass data into your builder commands
envUse this parameter to provide a value for an environment variable
Specify a parameter of array type by using the
$(params.your-array-parameter-name[*])syntax. After specifying the array, you can use it in an argument or a command. For each item in the array, an argument will be set. The following example uses an array parameter in thespec.stepsfield of the build strategy:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Provide parameter values as simple strings or as references to keys in config maps or secrets. For a parameter, you can use a config map or secret value only if it is defined in the
command,args, orenvsection of thespec.stepsfield.
2.2. System parameters definition Copy linkLink copied to clipboard!
You can use system parameters when defining the steps of a build strategy to access system information, or user-defined information in a Build or BuildRun custom resource (CR). You cannot configure or modify system parameters as they are defined at runtime by the build run controller.
You can define the following system parameters in your build strategy definition:
| Parameter | Description |
|---|---|
|
| Denotes the absolute path to the directory that contains the source code. |
|
|
Denotes the absolute path to the context directory of the source code. If you do not specify any value for |
|
|
Denotes the URL of the image to push as defined in the |
2.3. Step resources definition Copy linkLink copied to clipboard!
You can include a definition of resources, such as the limit imposed on CPU, memory, and disk usage for all steps in a build strategy. For strategies with multiple steps, a step might require more resources than others. As a strategy administrator, you can define the resource values that are optimal for each step.
For example, you can install strategies with the same steps, but different names and step resources on the cluster so that users can create a build with smaller or larger resource requirements.
2.3.1. Strategies with different resources Copy linkLink copied to clipboard!
Define multiple types of the same strategy with varying limits on the resources. The following examples use the same buildah strategy with small and medium limits defined for the resources. These examples provide a strategy administrator more control over the step resources definition.
2.3.1.1. Buildah strategy with small limit Copy linkLink copied to clipboard!
Define the spec.steps[].resources field with a small resource limit for the buildah strategy, as shown in the following example:
Example: buildah strategy with small limit
2.3.1.2. Buildah strategy with medium limit Copy linkLink copied to clipboard!
Define the spec.steps[].resources field with a medium resource limit for the buildah strategy, as shown in the following example:
Example: buildah strategy with medium limit
After configuring the resource definition for a strategy, you must reference the strategy in your Build CR, as shown in the following example:
2.3.2. Resource management in Tekton pipelines Copy linkLink copied to clipboard!
The build controller works with the Tekton pipeline controller so that it can schedule pods for executing the strategy steps. At runtime, the build controller creates a Tekton TaskRun resource, and the TaskRun resource creates a new pod in the specific namespace. This pod then sequentially executes all of the strategy steps to build an image.
2.4. Annotations definition Copy linkLink copied to clipboard!
You can define annotations for a build strategy or a cluster build strategy like for any other Kubernetes object. The build strategy first propagates annotations to the TaskRun resource. Then, Tekton propagates them to the pod.
You can use annotations for the following purposes:
-
To limit the network bandwidth the pod is allowed to use, the
kubernetes.io/ingress-bandwidthandkubernetes.io/egress-bandwidthannotations are defined in the Kubernetes network traffic shaping feature. -
To define the AppArmor profile of a container, the
container.apparmor.security.beta.kubernetes.io/<container_name>annotation is used.
The following example shows the usage of annotations in a build strategy:
The following annotations are not propagated:
-
kubectl.kubernetes.io/last-applied-configuration -
clusterbuildstrategy.shipwright.io/* -
buildstrategy.shipwright.io/* -
build.shipwright.io/* -
buildrun.shipwright.io/*
A strategy administrator can further restrict the usage of annotations by using policy engines.
2.5. Secure referencing of string parameters Copy linkLink copied to clipboard!
String parameters are used when you define environment variables, arguments, or images in a BuildStrategy or ClusterBuildStrategy custom resource (CR). In your build strategy steps, you can reference string parameters by using the $(params.your-parameter-name) syntax.
You can also reference system parameters and strategy parameters by using the $(params.your-parameter-name) syntax in your build strategy steps.
In the pod, all $(params.your-parameter-name) variables are replaced by actual strings. However, you must pay attention when you reference a string parameter in an argument by using an inline script. For example, to securely pass a parameter value into an argument defined with a script, you can choose one of the following approaches:
- Use environment variables
- Use arguments
Example: Referencing a string parameter into an environment variable
You can pass the string parameter into an environment variable, instead of directly using it inside the script. By using quoting around the environment variable, you can avoid the command injection vulnerability. You can use this approach for strategies, such as buildah. The following example uses an environment variable inside the script to reference a string parameter:
Example: Referencing a string parameter into an argument
You can pass the string parameter into an argument defined within your script. Appropriate shell quoting guards against command injection. You can use this approach for strategies, such as buildah. The following example uses an argument defined within your script to reference a string parameter:
2.6. System results definition Copy linkLink copied to clipboard!
You can store the size and digest of the image that is created by your build strategy to a set of result files. You can also store error details for debugging purposes when a BuildRun resource fails. You can define the following result parameters in your BuildStrategy or ClusterBuildStrategy CR:
| Parameter | Description |
|---|---|
|
| Denotes the path to the file that stores the digest of the image. |
|
| Denotes the path to the file that stores the compressed size of the image. |
|
| Denotes the path to the file that stores the error reason. |
|
| Denotes the path to the file that stores the error message. |
The following example shows the size and digest of the image in the .status.output field of the BuildRun CR:
The following example shows the error reason and message in the .status.failureDetails field of the BuildRun CR:
2.7. Volumes and volume mounts definition Copy linkLink copied to clipboard!
A build strategy includes the definition of volumes and volume mounts. The volumes defined in a build strategy support all of the usual volumeSource types. The build steps refer to the volumes by creating a volume mount.
The volume mount defined in build steps allows you to access volumes defined in a BuildStrategy, Build or BuildRun resource.
Volumes in build strategy use an overridable boolean flag, which is set to false by default. If a Build or BuildRun resource tries to override the volumes defined in a BuildStrategy resource, it will fail because the default value of the overridable flag is false.
The following example shows a BuildStrategy resource that defines the volumes and volumeMounts fields:
Chapter 3. Configuring build runs Copy linkLink copied to clipboard!
In a BuildRun custom resource (CR), you can define the build reference, build specification, parameter values, service account, output, retention parameters, and volumes to configure a build run. A BuildRun resource is available for use within a namespace.
For configuring a build run, create a BuildRun resource YAML file and apply it to the OpenShift Container Platform cluster.
3.1. Configurable fields in build run Copy linkLink copied to clipboard!
You can use the following fields in your BuildRun custom resource (CR):
| Field | Presence | Description |
|---|---|---|
|
| Required |
Specifies the API version of the resource. For example, |
|
| Required |
Specifies the type of the resource. For example, |
|
| Required |
Indicates the metadata that identifies the custom resource definition instance. For example, the name of the |
|
| Optional |
Specifies an existing |
|
| Optional |
Specifies an embedded |
|
| Optional | Indicates the service account to use when building the image. |
|
| Optional |
Defines a custom timeout. This field value overwrites the value of the |
|
| Optional |
Indicates a name-value list to specify values for parameters defined in the build strategy. The parameter value overwrites the value of the parameter that is defined with the same name in your |
|
| Optional |
Indicates a custom location where the generated image will be pushed. This field value overwrites the value of the |
|
| Optional |
Indicates an existing secret to get access to the container registry. This secret will be added to the service account along with other secrets requested by the |
|
| Optional |
Defines additional environment variables that you can pass to the build container. This field value overrides any environment variables that are specified in the |
You cannot use the spec.build.name and spec.build.spec fields together in the same CR because they are mutually exclusive.
3.2. Build reference definition Copy linkLink copied to clipboard!
You can configure the spec.build.name field in your BuildRun resource to reference a Build resource that indicates an image to build. The following example shows a BuildRun CR that configures the spec.build.name field:
3.3. Build specification definition Copy linkLink copied to clipboard!
You can embed a complete build specification into your BuildRun resource using the spec.build.spec field. By embedding specifications, you can build an image without creating and maintaining a dedicated Build custom resource. The following example shows a BuildRun CR that configures the spec.build.spec field:
You cannot use the spec.build.name and spec.build.spec fields together in the same CR because they are mutually exclusive.
3.4. Parameter values definition for a build run Copy linkLink copied to clipboard!
You can specify values for the build strategy parameters in your BuildRun CR. If you have provided a value for a parameter that is also defined in the Build resource with the same name, then the value defined in the BuildRun resource takes priority.
In the following example, the value of the cache parameter in the BuildRun resource overrides the value of the cache parameter, which is defined in the Build resource:
3.5. Service account definition Copy linkLink copied to clipboard!
You can define a service account in your BuildRun resource. The service account hosts all secrets referenced in your Build resource, as shown in the following example:
- 1
- You can also set the value of the
spec.serviceAccountfield to".generate"to generate the service account during runtime. The name of the generated service account corresponds with the name of theBuildRunresource.
When you do not define the service account, the BuildRun resource uses the pipeline service account if it exists in the namespace. Otherwise, the BuildRun resource uses the default service account.
3.6. Retention parameters definition for a build run Copy linkLink copied to clipboard!
You can specify the duration for which a completed build run can exist in your BuildRun resource. Retention parameters provide a way to clean your BuildRun instances automatically. You can set the value of the following retention parameters in your BuildRun CR:
-
retention.ttlAfterFailed: Specifies the duration for which a failed build run can exist -
retention.ttlAfterSucceeded: Specifies the duration for which a successful build run can exist
The following example shows how to define retention parameters in your BuildRun CR:
If you have defined a retention parameter in both BuildRun and Build CRs, the value defined in the BuildRun CR overrides the value of the retention parameter defined in the Build CR.
3.7. Volumes definition for a build run Copy linkLink copied to clipboard!
You can define volumes in your BuildRun CR. The defined volumes override the volumes specified in the BuildStrategy resource. If a volume is not overridden, then the build run fails.
In case the Build and BuildRun resources override the same volume, the volume defined in the BuildRun resource is used for overriding.
The following example shows a BuildRun CR that uses the volumes field:
3.8. Environment variables definition Copy linkLink copied to clipboard!
You can use environment variables in your BuildRun CR based on your needs. The following example shows how to define environment variables:
Example: Defining a BuildRun resource with environment variables
The following example shows a BuildRun resource that uses the Kubernetes downward API to expose a pod as an environment variable:
Example: Defining a BuildRun resource to expose a pod as an environment variable
The following example shows a BuildRun resource that uses the Kubernetes downward API to expose a container as an environment variable:
Example: Defining a BuildRun resource to expose a container as an environment variable
3.9. Build run status Copy linkLink copied to clipboard!
The BuildRun resource updates whenever the image building status changes, as shown in the following examples:
Example: BuildRun with Unknown status
oc get buildrun buildah-buildrun-mp99r
$ oc get buildrun buildah-buildrun-mp99r
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
buildah-buildrun-mp99r Unknown Unknown 1s
Example: BuildRun with True status
oc get buildrun buildah-buildrun-mp99r
$ oc get buildrun buildah-buildrun-mp99r
NAME SUCCEEDED REASON STARTTIME COMPLETIONTIME
buildah-buildrun-mp99r True Succeeded 29m 20m
A BuildRun resource stores the status-related information in the status.conditions field. For example, a condition with the type Succeeded indicates that resources have successfully completed their operation. The status.conditions field includes significant information like status, reason, and message for the BuildRun resource.
3.9.1. Build run statuses description Copy linkLink copied to clipboard!
A BuildRun custom resource (CR) can have different statuses during the image building process. The following table covers the different statuses of a build run:
| Status | Cause | Description |
|---|---|---|
|
|
|
The |
|
|
|
The |
|
|
| The user has requested to cancel the build run. This request triggers the build run controller to make a request for canceling the related task runs. Cancellation is still under process when this status is present. |
|
|
|
The pod for the |
|
|
|
The |
|
|
|
The execution of the |
|
|
|
The strategy type defined in the |
|
|
| The referenced cluster-scoped strategy was not found in the cluster. |
|
|
| The referenced namespace-scoped strategy was not found in the cluster. |
|
|
|
Setting the |
|
|
|
The |
|
|
|
The generation of a |
|
|
|
You have not provided any value for some parameters that are defined in the build strategy without any default. You must provide the values for those parameters in the |
|
|
| A value for a system parameter was provided, which is not allowed. |
|
|
| A value for a parameter was provided that is not defined in the build strategy. |
|
|
| A value was provided for a build strategy parameter with the wrong type. For example, if the parameter is defined as an array or a string in the build strategy, you must provide a set of values or a direct value accordingly. |
|
|
|
A value for a parameter contained more than one of these values: |
|
|
|
An item inside the values of an array parameter contained none of these values: |
|
|
|
A value for a parameter contained a |
|
|
|
A value for a parameter contained a |
|
|
| The referenced service account was not found in the cluster. |
|
|
|
The referenced build in the |
|
|
|
The referenced build in the |
|
|
|
The |
|
|
|
The defined build run name in the |
|
|
|
The |
|
|
|
The defined |
|
|
|
The defined |
|
|
| The build run pod was evicted from the node it was running on. |
3.9.2. Failed build runs Copy linkLink copied to clipboard!
When a build run fails, you can check the status.failureDetails field in your BuildRun CR to identify the exact point where the failure happened in the pod or container. The status.failureDetails field includes an error message and a reason for the failure. You only see the message and reason for failure if they are defined in your build strategy.
The following example shows a failed build run:
The status.failureDetails field also provides error details for all operations related to Git.
3.9.3. Step results in build run status Copy linkLink copied to clipboard!
After a BuildRun resource completes its execution, the .status field contains the .status.taskResults result emitted from the steps generated by the build run controller. The result includes the image digest or the commit SHA of the source code that is used for building the image. In a BuildRun resource, the .status.sources field contains the result from the execution of source steps and the .status.output field contains the result from the execution of output steps.
The following example shows a BuildRun resource with step results for a Git source:
Example: A BuildRun resource with step results for a Git source
The following example shows a BuildRun resource with step results for a local source code:
Example: A BuildRun resource with step results for a local source code
You get to see the digest and size of the output image only if it is defined in your build strategy.
3.9.4. Build snapshot Copy linkLink copied to clipboard!
For each build run reconciliation, the buildSpec field in the status of the BuildRun resource updates if an existing task run is part of that build run.
During this update, a Build resource snapshot generates and embeds into the status.buildSpec field of the BuildRun resource. Due to this, the buildSpec field contains an exact copy of the original Build specification, which was used to execute a particular image build. By using the build snapshot, you can see the original Build resource configuration.
3.10. Relationship of build run with Tekton tasks Copy linkLink copied to clipboard!
The BuildRun resource delegates the task of image construction to the Tekton TaskRun resource, which runs all steps until either the completion of the task, or a failure occurs in the task.
During the build run reconciliation, the build run controller generates a new TaskRun resource. The controller embeds the required steps for a build run execution in the TaskRun resource. The embedded steps are defined in your build strategy.
3.11. Build run cancellation Copy linkLink copied to clipboard!
You can cancel an active BuildRun instance by setting its state to BuildRunCanceled. When you cancel a BuildRun instance, the underlying TaskRun resource is also marked as canceled.
The following example shows a canceled build run for a BuildRun resource:
3.12. Automatic build run deletion Copy linkLink copied to clipboard!
To automatically delete a build run, you can add the following retention parameters in the build or buildrun specification:
buildrunTTL parameters: Ensures that build runs only exist for a defined duration of time after completion.-
buildrun.spec.retention.ttlAfterFailed: The build run is deleted if the specified time has passed and the build run has failed. -
buildrun.spec.retention.ttlAfterSucceeded: The build run is deleted if the specified time has passed and the build run has succeeded.
-
buildTTL parameters: Ensures that build runs for a build only exist for a defined duration of time after completion.-
build.spec.retention.ttlAfterFailed: The build run is deleted if the specified time has passed and the build run has failed for the build. -
build.spec.retention.ttlAfterSucceeded: The build run is deleted if the specified time has passed and the build run has succeeded for the build.
-
buildlimit parameters: Ensures that only a limited number of succeeded or failed build runs can exist for a build.-
build.spec.retention.succeededLimit: Defines the number of succeeded build runs that can exist for the build. -
build.spec.retention.failedLimit: Defines the number of failed build runs that can exist for the build.
-
Legal Notice
Copy linkLink copied to clipboard!
Copyright © 2025 Red Hat
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation’s permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.