Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 tilt: disable leader election when debugging is enabled #5750

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down