]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: config: emit warning for empty args when *not* in discovery mode
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Nov 2025 16:57:37 +0000 (17:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Nov 2025 18:57:44 +0000 (19:57 +0100)
commit004e1be48e1d9471731d4a723d63fc69f6d8d211
treedaf31126dc734849625396519edb379e807925ff
parent0144426dfb1281f76f5885146035049bedbb494b
BUG/MINOR: config: emit warning for empty args when *not* in discovery mode

This actually reverses the condition of commit 5f1fad1690 ("BUG/MINOR:
config: emit warning for empty args only in discovery mode"). Indeed,
some variables are not known in discovery mode (e.g. HAPROXY_LOCALPEER),
and statements like:

   peer "${HAPROXY_LOCALPEER}" 127.0.0.1:10000

are broken during discovery mode. It turns out that the warning is
currently hidden by commit ff8db5a85d ("BUG/MINOR: config: Stopped
parsing upon unmatched environment variables") since it silently drops
empty args which is sufficient to hide the warning, but it also breaks
other configs and needs to be reverted, which will break configs like
above again.

In issue #2995 we were not fully decided about discovery mode or not,
and already suspected some possible issues without being able to guess
which ones. The only downside of not displaying them in discovery mode
is that certain empty fields on the rare keywords specific to master
mode might remain silent until used. Let's just flip the condition to
check for empty args in normal mode only.

This should be backported to 3.2 after some time of observation.
src/cfgparse.c