From b04c81199d4f31122b85a55ef83564e9fc7ec504 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 18 Jan 2024 21:12:25 +0100 Subject: [PATCH] confd: add support for host containers, shares host's interfaces Signed-off-by: Joachim Wiberg --- src/confd/src/infix-containers.c | 3 +++ src/confd/yang/infix-containers@2023-12-14.yang | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/confd/src/infix-containers.c b/src/confd/src/infix-containers.c index d2f270a4..14c78e4d 100644 --- a/src/confd/src/infix-containers.c +++ b/src/confd/src/infix-containers.c @@ -69,6 +69,9 @@ static int add(const char *name, struct lyd_node *cif) } } + if (lydx_is_enabled(cif, "host-network")) + fprintf(fp, " host"); + fprintf(fp, "\n"); fchmod(fileno(fp), 0700); fclose(fp); diff --git a/src/confd/yang/infix-containers@2023-12-14.yang b/src/confd/yang/infix-containers@2023-12-14.yang index 357fe758..3805adb9 100644 --- a/src/confd/yang/infix-containers@2023-12-14.yang +++ b/src/confd/yang/infix-containers@2023-12-14.yang @@ -87,15 +87,16 @@ module infix-containers { choice network { description "Select network mode: none, host, or container network interfaces."; - case host { + case host-network { leaf host { - description "Run as host container, with full access to all network interfaces."; + description "Run in same network namespace as host."; type boolean; } } case network { list network { + description "Container network interface to connect to the container."; key name; leaf name {