diff options
author | Christian Breunig <christian@breunig.cc> | 2023-03-28 21:34:15 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-03-28 21:34:15 +0200 |
commit | 4a58a27adad59f19c7d14d0b9753259baed011f4 (patch) | |
tree | 9146968f46aebd30f1160427e5a416a4f4a61a29 /src/conf_mode/container.py | |
parent | b5d940d9f279a8391c8d8c56cc86f4855c9d38b5 (diff) | |
download | vyos-1x-4a58a27adad59f19c7d14d0b9753259baed011f4.tar.gz vyos-1x-4a58a27adad59f19c7d14d0b9753259baed011f4.zip |
container: T2216: explicitly select CNI network backend
As podman is going to use netavark as new default we must explicitly select
the old driver until we have migrated to netavark.
Diffstat (limited to 'src/conf_mode/container.py')
-rwxr-xr-x | src/conf_mode/container.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py index 68070ea5b..44c9b74da 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -38,8 +38,9 @@ from vyos import ConfigError from vyos import airbag airbag.enable() -config_containers_registry = '/etc/containers/registries.conf' -config_containers_storage = '/etc/containers/storage.conf' +config_containers = '/etc/containers/containers.conf' +config_registry = '/etc/containers/registries.conf' +config_storage = '/etc/containers/storage.conf' systemd_unit_path = '/run/systemd/system' def _cmd(command): @@ -335,10 +336,9 @@ def generate_run_arguments(name, container_config): def generate(container): # bail out early - looks like removal from running config if not container: - if os.path.exists(config_containers_registry): - os.unlink(config_containers_registry) - if os.path.exists(config_containers_storage): - os.unlink(config_containers_storage) + for file in [config_containers, config_registry, config_storage]: + if os.path.exists(file): + os.unlink(file) return None if 'network' in container: @@ -390,8 +390,9 @@ def generate(container): if rc != 0: raise ConfigError(out) - render(config_containers_registry, 'container/registries.conf.j2', container) - render(config_containers_storage, 'container/storage.conf.j2', container) + render(config_containers, 'container/containers.conf.j2', container) + render(config_registry, 'container/registries.conf.j2', container) + render(config_storage, 'container/storage.conf.j2', container) if 'name' in container: for name, container_config in container['name'].items(): |