8.4. 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:
oc adm prune builds [<options>]
$ oc adm prune builds [<options>]
| Option | Description |
|---|---|
|
| Indicate that pruning should occur, instead of performing a dry-run. |
|
| Prune all builds whose build configuration no longer exists, status is complete, failed, error, or canceled. |
|
|
Per build configuration, keep the last |
|
|
Per build configuration, keep the last |
|
|
Do not prune any object that is younger than |
To see what a pruning operation would delete:
oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m
$ oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m
To actually perform the prune operation:
oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m --confirm
$ oc adm prune builds --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m --confirm
Developers can enable automatic build pruning by modifying their build configuration.
Additional resources