mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-06 06:46:26 +01:00
63 lines
1.5 KiB
Plaintext
63 lines
1.5 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * applications/pruning-objects.adoc
|
|
|
|
[id="pruning-builds_{context}"]
|
|
= Pruning builds
|
|
|
|
In order to prune builds that are no longer required by the system due to age
|
|
and status, administrators can run the following command:
|
|
|
|
[source,terminal]
|
|
----
|
|
$ oc adm prune builds [<options>]
|
|
----
|
|
|
|
.Prune builds CLI configuration options
|
|
[cols="4,8",options="header"]
|
|
|===
|
|
|
|
|Option |Description
|
|
|
|
.^|`--confirm`
|
|
|Indicate that pruning should occur, instead of performing a dry-run.
|
|
|
|
.^|`--orphans`
|
|
|Prune all builds whose Build Configuration no longer exists, status is complete,
|
|
failed, error, or canceled.
|
|
|
|
.^|`--keep-complete=<N>`
|
|
|Per Build Configuration, keep the last `N` builds whose status is complete (default
|
|
`5`).
|
|
|
|
.^|`--keep-failed=<N>`
|
|
|Per Build Configuration, keep the last `N` builds whose status is failed, error, or
|
|
canceled (default `1`).
|
|
|
|
.^|`--keep-younger-than=<duration>`
|
|
|Do not prune any object that is younger than `<duration>` relative to the
|
|
current time (default `60m`).
|
|
|===
|
|
|
|
To see what a pruning operation would delete:
|
|
|
|
[source,terminal]
|
|
----
|
|
$ oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
|
|
--keep-younger-than=60m
|
|
----
|
|
|
|
To actually perform the prune operation:
|
|
|
|
[source,terminal]
|
|
----
|
|
$ oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
|
|
--keep-younger-than=60m --confirm
|
|
----
|
|
|
|
[NOTE]
|
|
====
|
|
Developers can enable automatic build pruning by modifying their Build
|
|
Configuration.
|
|
====
|