diff options
author | Christian Breunig <christian@breunig.cc> | 2024-02-27 22:20:41 +0100 |
---|---|---|
committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-02-28 19:13:09 +0000 |
commit | d3361ea09d09827b72f37f386cc1c0fac3ceaef1 (patch) | |
tree | 17058ce48d8c288566de4a77884556beda3a143d | |
parent | 0be3d1f64bea6e3b52f58a1da056179f88baff9d (diff) | |
download | vyos-1x-d3361ea09d09827b72f37f386cc1c0fac3ceaef1.tar.gz vyos-1x-d3361ea09d09827b72f37f386cc1c0fac3ceaef1.zip |
container: T6074: do not allow deleting images which have a container running
The current VyOS container image manipulation "delete container image" command
allows force removal of container images - even if they still have a container
running.
Drop the --force option from the op-mode script.
vyos@vyos:~$ delete container image 2636705a815a
Error: image used by 6adb0175d47f.. image is in use by a container: consider
listing external containers and force-removing image
(cherry picked from commit bfc065f2c4dcfc969981453e49b8156330674006)
-rwxr-xr-x | src/op_mode/container.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/op_mode/container.py b/src/op_mode/container.py index dcbb4dc55..d29af8821 100755 --- a/src/op_mode/container.py +++ b/src/op_mode/container.py @@ -75,7 +75,7 @@ def delete_image(name: str): if not name: return # replace newline with whitespace name = name.replace('\n', ' ') - rc, output = rc_cmd(f'podman image rm --force {name}') + rc, output = rc_cmd(f'podman image rm {name}') if rc != 0: raise vyos.opmode.InternalError(output) |