summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorNicolas Vollmar <nvo@scaling.ch>2024-12-10 06:13:32 +0100
committerNicolas Vollmar <nvollmar@gmail.com>2024-12-10 21:30:48 +0100
commit2de9fc6c1c0ee4fb814bb48cfe8b260453f80436 (patch)
treeeb092c94e07493a9d63d561f9ebd665f8d36bdbb /src/conf_mode
parent3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e (diff)
downloadvyos-1x-2de9fc6c1c0ee4fb814bb48cfe8b260453f80436.tar.gz
vyos-1x-2de9fc6c1c0ee4fb814bb48cfe8b260453f80436.zip
T6927: add name server validation
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/container.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index 4d3962029..594de3eb0 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -148,6 +148,9 @@ def verify(container):
if network_name not in container.get('network', {}):
raise ConfigError(f'Container network "{network_name}" does not exist!')
+ if 'name_server' in container_config and 'no_name_server' not in container['network'][network_name]:
+ raise ConfigError(f'Setting name server has no effect when attached container network has DNS enabled!')
+
if 'address' in container_config['network'][network_name]:
cnt_ipv4 = 0
cnt_ipv6 = 0