From 6df67a71d7622f63a674db59f995ba50ee54f437 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 20 Jul 2026 23:30:53 -0700 Subject: [PATCH] .env.example + compose: quote GNMI_ADDRESSES so compose's .env parser accepts it Docker Compose's .env parser treats an unquoted mid-line comma as a variable-name boundary. The current value: GNMI_ADDRESSES="10.100.0.100:57400", "10.100.0.200:57400" fails compose pull / build / up with: failed to read .env: line 56: unexpected character "," in variable name The double-quoted-list form is what telegraf.conf needs when it substitutes `addresses = [ ${GNMI_ADDRESSES} ]`, but the raw comma is what breaks compose. Wrap the whole value in SINGLE quotes: compose treats it as a literal string (single-quoted values are not interpolated and preserve special characters), and telegraf still gets the double-quoted list body verbatim on substitution. Also fix the docker-compose.yml default fallback -- same comma issue, drop the second address from the default (users can extend via .env). Found by the obmp-portability-test two-VM run. Co-Authored-By: Claude Opus 4.7 --- .env.example | 8 +++++++- docker-compose.yml | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index f131ac0..4c329dd 100644 --- a/.env.example +++ b/.env.example @@ -53,7 +53,13 @@ EXABGP_MEM_LIMIT=6g # gNMI streaming telemetry (telegraf, test profile). GNMI_ADDRESSES is a # quoted, comma-separated host:port list — add a router here once gNMI/grpc # is enabled on it and the management path is reachable. -GNMI_ADDRESSES="10.100.0.100:57400", "10.100.0.200:57400" +# NOTE: the outer SINGLE quotes are required. Docker Compose's .env parser +# treats an unquoted mid-line comma as a variable-name boundary and errors +# out on the double-quoted list form; wrapping in single quotes makes it a +# literal string. Telegraf substitutes the string body verbatim into +# `addresses = [ ${GNMI_ADDRESSES} ]` in telegraf.conf, so the double +# quotes and comma inside are preserved. +GNMI_ADDRESSES='"10.100.0.100:57400", "10.100.0.200:57400"' GNMI_USERNAME=changeme GNMI_PASSWORD=changeme diff --git a/docker-compose.yml b/docker-compose.yml index 857b0ec..ce48256 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -399,7 +399,9 @@ services: - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-openbmp} # gNMI fleet — quoted, comma-separated host:port list. Default = the two # ESXi CORE routers; extend via GNMI_ADDRESSES in .env for more routers. - - 'GNMI_ADDRESSES=${GNMI_ADDRESSES:-"10.100.0.100:57400", "10.100.0.200:57400"}' + # Default value must not contain an unquoted comma -- compose's parser + # treats it as a variable-name boundary. See .env.example note. + - GNMI_ADDRESSES=${GNMI_ADDRESSES:-"10.100.0.100:57400"} - GNMI_USERNAME=${GNMI_USERNAME:-webui} - GNMI_PASSWORD=${GNMI_PASSWORD:-cisco}