diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-11-04 17:53:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-04 17:53:11 +0200 |
| commit | cc60275ab0db2c45f2ad7387d6a91a96fa9d6337 (patch) | |
| tree | a59baa904529193481c12fb112a2de29b9d08608 /src/op_mode | |
| parent | 6d0324506a5b0419eb0ae001d8d006a414030405 (diff) | |
| parent | ae6d3437dc3247c396444b7f65eb49a98b0dd800 (diff) | |
| download | vyos-1x-cc60275ab0db2c45f2ad7387d6a91a96fa9d6337.tar.gz vyos-1x-cc60275ab0db2c45f2ad7387d6a91a96fa9d6337.zip | |
Merge pull request #4828 from c-po/restart-container-vrf
container: T7305: fix VRF loss when restarting pods
Diffstat (limited to 'src/op_mode')
| -rwxr-xr-x | src/op_mode/container.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/op_mode/container.py b/src/op_mode/container.py index a34901cb4..281c95e2c 100755 --- a/src/op_mode/container.py +++ b/src/op_mode/container.py @@ -166,6 +166,8 @@ def show_network(raw: bool): def restart(name: str): from vyos.utils.process import rc_cmd + from vyos.config import Config + from vyos.container import restart_network rc, output = rc_cmd(f'systemctl restart vyos-container-{name}.service') if rc != 0: @@ -173,6 +175,13 @@ def restart(name: str): if rc2 != 0: print(output) return None + if rc == 0: + conf = Config() + container = conf.get_config_dict(['container'], key_mangling=('-', '_'), + no_tag_node_value_mangle=True, + get_first_key=True, + with_recursive_defaults=True) + restart_network(container) print(f'Container "{name}" restarted!') return output |
