diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-08-19 17:41:36 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-08-19 17:48:42 -0400 |
commit | 1244d9e92ca35fb2281686805335dbf88307328a (patch) | |
tree | 9352c4f549caaa2052fc3f99fe1ddfd81a242d80 /cni | |
parent | 9babd21dfc263b0a63fc96eec0de2a6d0d834ab5 (diff) | |
download | podman-1244d9e92ca35fb2281686805335dbf88307328a.tar.gz podman-1244d9e92ca35fb2281686805335dbf88307328a.tar.bz2 podman-1244d9e92ca35fb2281686805335dbf88307328a.zip |
Unmount c/storage containers before removing them
When `podman rmi --force` is run, it will remove any containers
that depend on the image. This includes Podman containers, but
also any other c/storage users who may be using it. With Podman
containers, we use the standard Podman removal function for
containers, which handles all edge cases nicely, shutting down
running containers, ensuring they're unmounted, etc.
Unfortunately, no such convient function exists (or can exist)
for all c/storage containers. Identifying the PID of a Buildah,
CRI-O, or Podman container is extremely different, and those are
just the implementations under the containers org. We can't
reasonably be able to know if a c/storage container is *in use*
and safe for removal if it's not a Podman container.
At the very least, though, we can attempt to unmount a storage
container before removing it. If it is in use, this will fail
(probably with a not-particularly-helpful error message), but if
it is not in use but not fully cleaned up, this should make our
removing it much more robust than it normally is.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'cni')
0 files changed, 0 insertions, 0 deletions