spiegel_podman/pkg
Ashley Cui 17dbce2fb0 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>
2022-07-26 13:32:33 -04:00
..
annotations fix a number of godot issues 2022-03-22 13:04:35 +01:00
api Podman stop --filter flag 2022-07-26 13:25:36 -04:00
auth pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
autoupdate pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
bindings Switch to github.com/blang/semver/v4 2022-07-26 13:22:46 -04:00
channel pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
checkpoint pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
copy pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
criu Fix spelling of GetCriuVersion 2022-06-27 12:57:44 +01:00
ctime golangci-lint: enable nolintlint 2022-06-14 16:29:42 +02:00
domain Podman stop --filter flag 2022-07-26 13:25:36 -04:00
env pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
errorhandling libpod/runtime: switch to golang native error wrapping 2022-07-04 15:39:00 +02:00
hooks pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
inspect pkg/inspect: remove unused ImageResult type 2022-05-24 16:07:39 +02:00
k8s.io Fix spelling "read only" -> "read-only" 2022-07-02 08:37:43 +02:00
lookup enable gocritic linter 2022-04-26 18:12:22 +02:00
machine Clean up cached machine images 2022-07-26 13:32:33 -04:00
namespaces Fix spelling "setup" -> "set up" and similar 2022-06-22 18:39:21 +02:00
parallel pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
ps libpod: switch to golang native error wrapping 2022-07-05 16:06:32 +02:00
rootless pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
rootlessport go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
seccomp pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
selinux Fix SELinux functions names to not be repetitive 2020-04-23 15:57:34 -04:00
servicereaper go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
signal Implement CatchAll and StopCatch in signal_common.go 2022-06-27 13:27:12 +01:00
specgen pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
specgenutil pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
systemd pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
terminal move golang.org/x/crypto/ssh/terminal to golang.org/x/term 2022-04-22 12:40:52 +02:00
timetype enable gocritic linter 2022-04-26 18:12:22 +02:00
trust pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
util pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00