From 3c02f0aedb55278d2fdf532a5d88e3c25b41a88a Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Mon, 29 Nov 2021 17:06:52 +0100 Subject: [PATCH] tilt: disable leader election when debugging is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- Tiltfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tiltfile b/Tiltfile index 0bef0a0dcd2e..1eda0385633f 100644 --- a/Tiltfile +++ b/Tiltfile @@ -366,10 +366,10 @@ def enable_providers(): enable_provider(name, settings.get("debug").get(name, {})) def kustomize_with_envsubst(path, enable_debug = False): - # we need to ditch the readiness and liveness probes when debugging, otherwise K8s will restart the pod whenever execution + # We need to ditch leader election, the readiness and liveness probes when debugging, otherwise K8s will restart the pod whenever execution # has paused. if enable_debug: - yq_cmd_line = "| {} eval 'del(.. | select(has\"livenessProbe\")).livenessProbe | del(.. | select(has\"readinessProbe\")).readinessProbe' -".format(yq_cmd) + yq_cmd_line = "| {} eval 'del(.. | select(. == \"--leader-elect\")) | del(.. | select(has\"livenessProbe\")).livenessProbe | del(.. | select(has\"readinessProbe\")).readinessProbe' -".format(yq_cmd) else: yq_cmd_line = "" return str(local("{} build {} | {} {}".format(kustomize_cmd, path, envsubst_cmd, yq_cmd_line), quiet = True))