mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 07:31:01 +02:00
Merge pull request #481 from marineam/prune
prune_images: keep newer-than-latest builds
This commit is contained in:
commit
7cea7f4d6f
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…
x
Reference in New Issue
Block a user