This repository was archived by the owner on Feb 24, 2020. It is now read-only.
This repository was archived by the owner on Feb 24, 2020. It is now read-only.
rkt image gc
does not consider prepare and run_prepared as having been used #3387Open
Description
Environment
rkt Version: 1.19.0
appc Version: 0.8.8
Go Version: go1.7.3
Go OS/Arch: linux/amd64
Features: -TPM +SDJOURNAL
--
Linux 4.7.0-0.bpo.1-amd64 x86_64
--
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
--
systemd 230
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN
What did you do?
$ sudo rkt image list
ID NAME SIZE IMPORT TIME LAST USED
sha512-6807fc094d72 coreos.com/rkt/stage1-coreos:1.19.0 102MiB 1 minute ago 1
minute ago
sha512-893b2f49db6b <host>/api:9118b14222f3973806cb762bde7ddde9171cf956 68MiB 1 minute ago 1
minute ago
sha512-b7d5fcc132bd <host>/java:4.0.6 407MiB 35 seconds ago 35 seconds ago
sha512-5d072546239b <host>/traitify-base:1.0.11 46MiB 27 seconds ago 27 seconds ago
sha512-2222d0a86708 quay.io/coreos/alpine-sh:latest 5.4MiB 26 seconds ago 26 seconds ago
$ sudo rkt run <host>/api:9118b14222f3973806cb762bde7ddde9171cf956 --exec /bin/sleep -- 2
$ sleep 300
$ sudo rkt image list
ID NAME SIZE IMPORT TIME LAST USED
sha512-6807fc094d72 coreos.com/rkt/stage1-coreos:1.19.0 102MiB 6 minutes ago 6
minutes ago
sha512-893b2f49db6b <host>/api:9118b14222f3973806cb762bde7ddde9171cf956 68MiB 6 minutes ago 6
minutes ago
sha512-b7d5fcc132bd <host>/java:4.0.6 407MiB 5 minutes ago 5
minutes ago
sha512-5d072546239b <host>/traitify-base:1.0.11 46MiB 5 minutes ago 5
minutes ago
sha512-2222d0a86708 quay.io/coreos/alpine-sh:latest 5.4MiB 5 minutes ago 5
minutes ago
$ sudo rkt prepare <host>/api:9118b14222f3973806cb762bde7ddde9171cf956 --exec /bin/sleep -- 2
294e0092-8520-4e9f-8c3a-f241535969fb
$ sudo rkt run-prepared 294e0092-8520-4e9f-8c3a-f241535969fb
$ sudo rkt image gc --grace-period=2m
successfully removed aci for image: "sha512-6807fc094d72cb9c60ca0f9b0108366a101a1b8c73236b9898fc8bb9aa0a3554"
successfully removed aci for image: "sha512-893b2f49db6bb3b5e55667375c0f212ed4d4c9d72ba8878ac4820e230e90005e"
successfully removed aci for image: "sha512-b7d5fcc132bdb005766e96a92fb778957aa48840662779c77a4a08c48f9ab38d"
successfully removed aci for image: "sha512-5d072546239b5bb960866e25b2e392fea23c91f6de1cae5ed6f206fbcae4ec11"
successfully removed aci for image: "sha512-2222d0a867084bc1c6f47f86982867dcc013a1bcfab15128a1065108808fc998"
gc: 5 image(s) successfully removed
What did you expect to see?
I expected rkt to not remove the images that had prepare
and run_prepared
run against them within the last 2 minutes.
What did you see instead?
rkt does not consider prepare
and run_prepared
as having been "last used" and deletes them.