mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-06 20:47:00 +02:00
prune_images: keep newer-than-latest builds
This may include recent failures or builds derrived from latest, such as those made by image_set_group.
This commit is contained in:
parent
f0be34f4dd
commit
9a138677a8
10
prune_images
10
prune_images
@ -44,9 +44,13 @@ for board_path in "${board_paths[@]}"; do
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ ${FLAGS_keep_latest} -eq ${FLAGS_TRUE} &&
|
||||
"${board_path}/latest" -ef "${image_path}" ]]; then
|
||||
continue
|
||||
if [[ ${FLAGS_keep_latest} -eq ${FLAGS_TRUE} ]]; then
|
||||
# keep anything that is or newer than the latest
|
||||
if [[ "${board_path}/latest" -ef "${image_path}" || \
|
||||
"${board_path}/latest/version.txt" -ot \
|
||||
"${image_path}/version.txt" ]]; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# best effort attempt to clean up old mounts
|
||||
|
Loading…
Reference in New Issue
Block a user