From b26c2cfeff3130cac16d79a695beacf0dc963df4 Mon Sep 17 00:00:00 2001 From: Andrey Volkov Date: Wed, 3 Oct 2018 13:44:02 -0700 Subject: [PATCH] Make haproxy-anchor cleanup optional Continuation of Ia1449d188c15b71dd756e96b1ea2d4a672011a17. This patch creates the additional var "conf.anchor.enable_cleanup" that is true by default. False value will effectively disable cleanup procedure. Change-Id: I7f74454190dcd1d563d6cb3c9fef8504a3e0806a --- charts/haproxy/templates/bin/_anchor.tpl | 2 ++ charts/haproxy/values.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/charts/haproxy/templates/bin/_anchor.tpl b/charts/haproxy/templates/bin/_anchor.tpl index d84ca166..a910c467 100644 --- a/charts/haproxy/templates/bin/_anchor.tpl +++ b/charts/haproxy/templates/bin/_anchor.tpl @@ -124,7 +124,9 @@ cleanup() { while true; do if [ -e /tmp/stop ]; then echo Stopping + {%- if .Values.conf.anchor.enable_cleanup %} cleanup + {%- end %} break fi diff --git a/charts/haproxy/values.yaml b/charts/haproxy/values.yaml index fc6182e6..98400cef 100644 --- a/charts/haproxy/values.yaml +++ b/charts/haproxy/values.yaml @@ -41,6 +41,7 @@ conf: - mode tcp - option tcp-check - option redispatch + enable_cleanup: true haproxy: container_config_dir: /usr/local/etc/haproxy