diff options
author | Ashley Cui <acui@redhat.com> | 2022-07-08 20:10:25 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-07-26 13:32:33 -0400 |
commit | 17dbce2fb060b4803b2dae4eb6b78fdebea5b61f (patch) | |
tree | d573c5222cd767a14e1b8bc0519e4ccc23bc6663 /cmd/podman/root.go | |
parent | e473c5e4b741cef2c1174cb4ec51000f443e6877 (diff) | |
download | podman-17dbce2fb060b4803b2dae4eb6b78fdebea5b61f.tar.gz podman-17dbce2fb060b4803b2dae4eb6b78fdebea5b61f.tar.bz2 podman-17dbce2fb060b4803b2dae4eb6b78fdebea5b61f.zip |
Clean up cached machine images
When initing machines, we download a machine image, and uncompress and
copy the image for the actual vm image. When a user constantly pulls new
machines, there may be a buildup of old, unused machine images. This
commit cleans ups the unused cached images.
Changes:
- If the machine is pulled from a URL or from the FCOS releases, we pull
them into XDG_DATA_HOME/containers/podman/machine/vmType/cache
- Cache cleanups only happen if there is a cache miss, and we need to
pull a new image
- For Fedora and FCOS, we actually use the cache, so we go through the
cache dir and remove any images older than 2 weeks (FCOS's release cycle), on a cache miss.
- For generic files pulled from a URL, we don't actually cache, so we
delete the pulled file immediately after creating a machine image
- For generic files from a local path, the original file will never be
cleaned up
Note that because we cache in a different dir, this will not clean up
old images pulled before this commit.
[NO NEW TESTS NEEDED]
Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'cmd/podman/root.go')
0 files changed, 0 insertions, 0 deletions