]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ext-check: add an option to preserve environment variables
authorWilly Tarreau <w@1wt.eu>
Thu, 23 Nov 2023 15:48:48 +0000 (16:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Nov 2023 15:53:57 +0000 (16:53 +0100)
commit1de44daf7d61828be1effd970817ee59ed8750d7
treed174a86f945f1fcac86050fb6cb0b68566896af8
parent0fccee6abe87a050c0f01f62434cf7ff915c88ac
MINOR: ext-check: add an option to preserve environment variables

In Github issue #2128, @jvincze84 explained the complexity of using
external checks in some advanced setups due to the systematic purge of
environment variables, and expressed the desire to preserve the
existing environment. During the discussion an agreement was found
around having an option to "external-check" to do that and that
solution was tested and confirmed to work by user @nyxi.

This patch just cleans this up, implements the option as
"preserve-env" and documents it. The default behavior does not change,
the environment is still purged, unless "preserve-env" is passed. The
choice of not using "import-env" instead was made so that we could
later use it to name specific variables that have to be imported
instead of keeping the whole environment.

The patch is simple enough that it could be backported if needed (and
was in fact tested on 2.6 first).
doc/configuration.txt
include/haproxy/global-t.h
src/cfgparse-global.c
src/extcheck.c