By default, builds that have completed their lifecycle are persisted indefinitely. You can limit the number of previous builds that are retained.
Procedure
-
Limit the number of previous builds that are retained by supplying a positive integer value for
successfulBuildsHistoryLimit
orfailedBuildsHistoryLimit
in yourBuildConfig
, for example:apiVersion: "v1" kind: "BuildConfig" metadata: name: "sample-build" spec: successfulBuildsHistoryLimit: 2 (1) failedBuildsHistoryLimit: 2 (2)
-
successfulBuildsHistoryLimit
will retain up to two builds with a status ofcompleted
. -
failedBuildsHistoryLimit
will retain up to two builds with a status offailed
,canceled
, orerror
.
-
-
Trigger build pruning by one of the following actions:
-
Updating a build configuration.
-
Waiting for a build to complete its lifecycle.
-
Builds are sorted by their creation timestamp with the oldest builds being pruned first.