diff options
author | Christian Breunig <christian@breunig.cc> | 2024-02-27 22:20:41 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-02-27 22:20:41 +0100 |
commit | bfc065f2c4dcfc969981453e49b8156330674006 (patch) | |
tree | 83722ce993a2ef84d6df28b485f8f9f3cb51a501 /src | |
parent | 8b87836b371fdddb595ad3faf8a91a64f07c2bfb (diff) | |
download | vyos-1x-bfc065f2c4dcfc969981453e49b8156330674006.tar.gz vyos-1x-bfc065f2c4dcfc969981453e49b8156330674006.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
Diffstat (limited to 'src')
-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) |