summaryrefslogtreecommitdiff
path: root/src/op_mode/container.py
AgeCommit message (Collapse)Author
2026-06-16T8923: normalize "can not" to "cannot"Christian Breunig
Replace two-word "can not" / "Can not" with "cannot" across comments, ConfigError messages, CLI help text, and op-mode output. Standard SNMP MIB files under mibs/ are left unchanged.
2026-03-24T8410: Fix typos and mistakes for operational and configuration commandsViacheslav Hletenko
Fix typos and mistakes in the commands and comments No functional changes
2026-02-02op-mode: T8018: disable buffered output when adding container imagesChristian Breunig
2025-11-03container: T7305: fix VRF loss when restarting podsChristian Breunig
Container networks are only started when there is at least one active consumer. If a network is created without any attached containers, it does not need to be assigned to a VRF yet. When the last container in a pod is stopped, its associated container network is removed. Upon container restart, the kernel recreates the network, but the VRF assignment may be lost in the process. This change ensures that all container networks are correctly reattached to their designated VRFs when a pod restarts.
2025-10-25T7957: filter stderr when deleting container imagesChristian Breunig
The call to rc_cmd('podman inspect ...') determines whether a container image scheduled for deletion has any ancestor containers still using it. Previously, if the podman command wrote output to stderr, rc_cmd() would return that error message alongside or instead of the ancestor container ID. This caused subsequent podman calls to fail, as the error string was incorrectly treated as a valid command argument. This change ensures only valid ancestor IDs are returned. This is a fix for commit a99ca6d11b5 ("op-mode: T7403: add option for forcefully remove a container image")
2025-09-18container: T6673: Fix restart of containers with podman (#4691)l0crian1
Fixed issue with podman and systemd sync when restarting containers with 'podman restart' command. - Placed podman storage directory in vyos/defaults.py - Replaced repeated declarations with vyos.defaults.directories['podman_storage']
2025-07-31op-mode: T7403: fix image deletion when a single image ID is providedChristian Breunig
Commit a99ca6d11 ("op-mode: T7403: add option for forcefully removing a container image") did not account for the case where a single image ID is passed as a string. This led to incorrect behavior during iteration. Without converting the string to a list, the code iterates over individual characters of the image ID rather than treating it as a single item. As a result, the system attempts to delete non-existent container images based on these characters.
2025-07-29op-mode: T7403: add option for forcefully remove a container imageChristian Breunig
If you have multiple images (tags) loaded for a container which point to the exact same hash - you can only forcefully delete them. vyos@vyos:~$ delete container image 70dc5806 Error: unable to delete image "70dc5806" by ID with more than one tag ([registry.io/foo/bar:v1.0 registry.io/foo/bar:v1.0.1]): please force removal In additon an image that is still beeing used can not be removed from the system as this would cause infinite container restarts. vyos@vyos:~$ delete container image all force Cannot delete image "d205499ae8bb" because it is currently being used by container "3b290f90e83d"!
2025-07-29op-mode: T7403: print STDOUT when adding a container imageChristian Breunig
2025-06-28T7591: remove copyright years from source filesChristian Breunig
The legal team says years are not necessary so we can go ahead with it, since it will simplify backporting. Automatically removed using: git ls-files | grep -v libvyosconfig | xargs sed -i -E \ 's/^# Copyright (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers.*/# Copyright VyOS maintainers and contributors <maintainers@vyos.io>/g' In addition we will error-out during "make" if someone re-adds a legacy copyright notice
2025-06-17container: T7473: fix show/monitor container log failed when log-driver is ↵opswill
journald
2024-04-03T6199: drop unused Python importsChristian Breunig
found using "git ls-files *.py | xargs pylint | grep W0611"
2024-02-27container: T6074: do not allow deleting images which have a container runningChristian Breunig
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
2024-02-24Merge pull request #3046 from c-po/container-T6060Christian Breunig
container: T6060: support removing all container images at once via op-mode
2024-02-24container: T6060: support removing all container images at once via op-modeChristian Breunig
cpo@LR1.wue3:~$ show container image REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/busybox latest 3f57d9401f8d 5 weeks ago 4.5 MB docker.io/jacobalberty/unifi v7.5 f6df690d6c67 4 months ago 827 MB docker.io/jacobalberty/unifi v7.4 7838b75ef7b9 7 months ago 786 MB cpo@LR1.wue3:~$ delete container image Possible completions: 3f57d9401f8d Delete container image 7838b75ef7b9 all f6df690d6c67 cpo@LR1.wue3:~$ delete container image all cpo@LR1.wue3:~$ show container image REPOSITORY TAG IMAGE ID CREATED SIZE
2024-02-24container: T5909: move registry login to op-modeChristian Breunig
It does not make sense to perform the "podman login" command when setting up containers, as images are not automatically pulled in from the registry - due to issues with the default route during startup. The same issue manifests in "podman login" where we can not login to a registry unless there is a default route present. This commit changes the behavior that the container registry is part of the configuration, but it is only referenced during "add container image" and thus never during system boot.
2023-07-14T5195: vyos.util -> vyos.utils package refactoring (#2093)Christian Breunig
* T5195: move run, cmd, call, rc_cmd helper to vyos.utils.process * T5195: use read_file and write_file implementation from vyos.utils.file Changed code automatically using: find . -type f -not -path '*/\.*' -exec sed -i 's/^from vyos.util import read_file$/from vyos.utils.file import read_file/g' {} + find . -type f -not -path '*/\.*' -exec sed -i 's/^from vyos.util import write_file$/from vyos.utils.file import write_file/g' {} + * T5195: move chmod* helpers to vyos.utils.permission * T5195: use colon_separated_to_dict from vyos.utils.dict * T5195: move is_systemd_service_* to vyos.utils.process * T5195: fix boot issues with missing imports * T5195: move dict_search_* helpers to vyos.utils.dict * T5195: move network helpers to vyos.utils.network * T5195: move commit_* helpers to vyos.utils.commit * T5195: move user I/O helpers to vyos.utils.io
2023-06-21op-mode: containers: T4585: fix grammar in user messageChristian Breunig
2023-02-09Revert "container: T4959: Add container registry authentication config for ↵Christian Breunig
containers" This reverts commit b17251334c57c2f6875c19ad4e6c6127aa9e1811.
2023-01-30container: T4959: Add container registry authentication config for containersZen3515
2023-01-09container: T4880: expose add_image/delete_image functions in op-modeJohn Estabrook
Encapsulating the add/delete image commands in the op-mode script allows automatic generation of corresponding API schema definitions.
2022-12-23containers: T4585: remove redundant sudo calls in op-mode scriptChristian Poessinger
2022-08-04T2719: add an exception hierarchy for op mode errorsDaniil Baturin
2022-08-02containers: T4585: Add option restart to containers.pyViacheslav Hletenko
Add option restart to `containers.py`
2022-08-02container: T4585: Rewrite show containerViacheslav Hletenko
Rewrite op-mode: - show container - show container network - show container image to the new vyos.opmode format