Fix readiness probe for containers without HEALTHCHECK#417
Closed
yonghaoy wants to merge 1 commit into
Closed
Conversation
The Go template `{{.State.Health.Status}}` behaves differently across
Docker versions when .State.Health is nil (no HEALTHCHECK configured).
Some versions return an empty string with exit 0, bypassing the
`|| echo "none"` fallback and causing the readiness probe to fail
indefinitely for non-SAS apps (jupyter, vscode, etc.).
Use a Go template conditional to handle nil .State.Health directly,
making the probe work reliably regardless of Docker version.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing in favor of #416 which correctly identified the root cause: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
probe-proxy-readiness.shto use a Go template conditional ({{if .State.Health}}) instead of relying ondocker inspectexit code to detect containers without a HEALTHCHECKProblem
PR #415 added health check awareness to the readiness probe, but the Go template
{{.State.Health.Status}}behaves differently across Docker versions when.State.Healthis nil (no HEALTHCHECK configured). Some Docker versions return an empty string with exit code 0, bypassing the|| echo "none"fallback. This causesAPP_HEALTH="", which matches neither"healthy"nor"none", so the readiness probe fails forever.Fix
The Go template conditional handles nil
.State.Healthdirectly inside the template, making it work reliably regardless of Docker version.Test plan
🤖 Generated with Claude Code