From ec3e9fc2768b481c25938b95201e6babe429863c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Tue, 4 Oct 2022 10:18:18 +0200 Subject: [PATCH] By default, unset everything proxy related for healthcheck Hopefully get out of the hell of proxy/no_proxy settings for healthchecks. Since operators continue to (ab)use the http_proxy, https_proxy and, especially, the no_proxy environment variables, and since this has been creating many, many, many issues within container healthchecks, and, finally, since proxy settings are mostly useless for that specific usecase, we just discard them by default. With this patch, the different healthchecks will go without using any proxy. This is mostly possible because checks are done on "internal" networks provided by TripleO, and there's no proxy in-between. Most of the connections are even on the local node, on its different and various associated IPs, so there's, really, no need to obey any proxy setting. Change-Id: Ic7928f7895d10aa4a8eb1d4e1f55fd30de83aee4 Resolves: rhbz#2121349 --- healthcheck/common.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/healthcheck/common.sh b/healthcheck/common.sh index 789f77388..87172b37c 100755 --- a/healthcheck/common.sh +++ b/healthcheck/common.sh @@ -12,6 +12,13 @@ fi : ${HEALTHCHECK_CURL_PY_USER_AGENT:=pyrequests-healthcheck} : ${HEALTHCHECK_CURL_WRITE_OUT:='\n%{http_code} %{remote_ip}:%{remote_port} %{time_total} seconds\n'} : ${HEALTHCHECK_CURL_OUTPUT:='/dev/null'} +: ${HEALTHCHECK_USE_PROXY:=0} +if [ $HEALTHCHECK_USE_PROXY -eq 0 ]; then + for prox_var in http_proxy https_proxy no_proxy; do + unset $prox_var + unset ${prox_var^^} + done +fi get_user_from_process() { process=$1