test/system: Remove stale cache directory left between pull attempts - #1828
Merged
debarshiray merged 1 commit intoJul 29, 2026
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
debarshiray
pushed a commit
to debarshiray/toolbox
that referenced
this pull request
Jul 29, 2026
When setting up caching for images, if an iteration of the retry loop to
download images to the cache fails, it leaves behind a stale cache which
will cause the next attempt to also fail with:
not ok 1 setup_suite
# (from function `_pull_and_cache_distro_image' in file
test/system/libs/helpers.bash, line 139,
# from function `setup_suite' in test file
test/system/setup_suite.bash, line 59)
# `_pull_and_cache_distro_image ubuntu 20.04' failed
# Failed to cache image quay.io/toolbx/ubuntu-toolbox:20.04 to
/tmp/bats-run-3FdzJ3/suite/image-cache/ubuntu-toolbox-20.04
# time="2026-07-28T22:40:16Z" level=fatal msg="initializing
destination
dir:/tmp/bats-run-3FdzJ3/suite/image-cache/ubuntu-toolbox-20.04:
not a containers image directory, don't want to overwrite
important data"
This is because skopeo(1) will refuse to write to the directory saying
it's not a valid containers image directory. Specifically, this is the
ErrNotContainerImageDir error from the go.podman.io/image/v5/directory
package [1].
Add a cleanup step to remove the directory before the next attempt to
avoid the issue.
[1] https://pkg.go.dev/go.podman.io/image/v5/directory
containers#1822
containers#1828
Signed-off-by: Rolv Apneseth <rolv.apneseth@gmail.com>
debarshiray
force-pushed
the
wip/rishi/test-system-libs-helpers-pull-cache-remove-stale-cache
branch
from
July 29, 2026 14:36
8188923 to
074026c
Compare
When setting up caching for images, if an iteration of the retry loop to
download images to the cache fails, it leaves behind a stale cache which
will cause the next attempt to also fail with:
not ok 1 setup_suite
# (from function `_pull_and_cache_distro_image' in file
test/system/libs/helpers.bash, line 139,
# from function `setup_suite' in test file
test/system/setup_suite.bash, line 59)
# `_pull_and_cache_distro_image ubuntu 20.04' failed
# Failed to cache image quay.io/toolbx/ubuntu-toolbox:20.04 to
/tmp/bats-run-3FdzJ3/suite/image-cache/ubuntu-toolbox-20.04
# time="2026-07-28T22:40:16Z" level=fatal msg="initializing
destination
dir:/tmp/bats-run-3FdzJ3/suite/image-cache/ubuntu-toolbox-20.04:
not a containers image directory, don't want to overwrite
important data"
This is because skopeo(1) will refuse to write to the directory saying
it's not a valid containers image directory. Specifically, this is the
ErrNotContainerImageDir error from the go.podman.io/image/v5/directory
package [1].
Add a clean-up step to remove the directory before the next attempt to
avoid the issue.
Shell parameter expansion [2] is used to ensure that rm(1) doesn't
recursively delete everything in the host operating system's root
directory [3] due to future programmer errors.
[1] https://pkg.go.dev/go.podman.io/image/v5/directory
[2] https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
[3] https://www.shellcheck.net/wiki/SC2115
containers#1822
containers#1828
Signed-off-by: Rolv Apneseth <rolv.apneseth@gmail.com>
debarshiray
force-pushed
the
wip/rishi/test-system-libs-helpers-pull-cache-remove-stale-cache
branch
from
July 29, 2026 20:10
074026c to
6c315e3
Compare
debarshiray
deleted the
wip/rishi/test-system-libs-helpers-pull-cache-remove-stale-cache
branch
July 29, 2026 21:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When setting up caching for images, if an iteration of the retry loop to download images to the cache fails, it leaves behind a stale cache which will cause the next attempt to also fail with:
This is because
skopeo(1)will refuse to write to the directory saying it's not a valid containers image directory. Specifically, this is theErrNotContainerImageDirerror from thego.podman.io/image/v5/directorypackage [1].Add a clean-up step to remove the directory before the next attempt to avoid the issue.
Shell parameter expansion [2] is used to ensure that
rm(1)doesn't recursively delete everything in the host operating system's root directory [3] due to future programmer errors.[1] https://pkg.go.dev/go.podman.io/image/v5/directory
[2] https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
[3] https://www.shellcheck.net/wiki/SC2115
#1822