Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 13 additions & 0 deletions templates/git-sync-relay/git-sync-relay-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,19 @@ spec:
{{- end }}
{{- if .Values.gitSyncRelay.gitSync.readinessProbe }}
readinessProbe: {{- tpl (toYaml .Values.gitSyncRelay.gitSync.readinessProbe) . | nindent 12 }}
{{- else }}
# Reflects the MOST RECENT sync attempt (initial, poll, or webhook), not just the
# pod's first one at startup -- so a Deployment's Gitsync URL edited to something
# invalid after the relay is already running marks this pod NotReady (PINF-816)
# instead of staying silently "ready" forever. Deliberately not a livenessProbe: a
# restart cannot fix a bad URL and would just crash-loop the pod pointlessly.
readinessProbe:
httpGet:
path: /readyz
port: {{ .Values.gitSyncRelay.gitSync.webhookPort }}
initialDelaySeconds: 5
periodSeconds: 15
failureThreshold: 3
{{- end }}
{{- if .Values.gitSyncRelay.gitSync.startupProbe }}
startupProbe: {{- tpl (toYaml .Values.gitSyncRelay.gitSync.startupProbe) . | nindent 12 }}
Expand Down
12 changes: 10 additions & 2 deletions tests/chart/test_git_sync_relay_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ def test_gsr_deployment_gsr_enabled_with_defaults(self, kube_version):
assert c_by_name["git-daemon"]["image"].startswith("quay.io/astronomer/ap-git-daemon:")
assert c_by_name["git-daemon"]["livenessProbe"]
assert c_by_name["git-daemon"]["startupProbe"]
# git-sync has no hardcoded probe fallback (customer-configurable only), unlike git-daemon
# git-sync has a hardcoded readinessProbe fallback (PINF-816: /readyz reflects the most
# recent sync attempt, so a bad repo URL marks this pod NotReady instead of staying
# silently "ready" forever) but no liveness/startup fallback -- a restart can't fix a
# bad URL, so liveness is deliberately left customer-configurable-only, like startup.
assert "livenessProbe" not in c_by_name["git-sync"]
assert "readinessProbe" not in c_by_name["git-sync"]
assert c_by_name["git-sync"]["readinessProbe"] == {
"httpGet": {"path": "/readyz", "port": 8000},
"initialDelaySeconds": 5,
"periodSeconds": 15,
"failureThreshold": 3,
}
assert "startupProbe" not in c_by_name["git-sync"]
assert c_by_name["git-sync"]["resources"] == {
"limits": {"cpu": "200m", "memory": "256Mi"},
Expand Down