Repository navigation
fix: wait for the pod image digest at start-up - #54
Merged
Merged
Conversation
On a first start the kubelet may not have filled in the container's ImageID yet, so Context Service exited with "container image digest is unavailable" and the pod restarted once. Poll for it every second for up to 30 seconds; API errors still fail immediately, and CS_UPLOAD_IMAGE still skips the lookup. Found by a Kind end-to-end run of Moca workloads. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jeremy Cohn <[email protected]>
evaline-ju
approved these changes
Oct 14, 2026
evaline-ju
left a comment
There was a problem hiding this comment.
resolveUploadImage polls ContainerStatuses for a non-empty ImageID every 1s up to 30s with immediate=true (no delay when the digest is already set), returns API errors immediately, and distinguishes timeout (errImageDigestUnavailable) from context cancellation. Four tests cover digest-on-3rd-read, timeout, API error, and cancellation.
Author: moonlight16 (MEMBER) · CI: only DCO configured here (passing)
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.
Found by a Kind end-to-end run of Moca workloads (rossoctl/moca#494, run tasks on a workload's context).
On a first start, the kubelet may not have filled in the container's
ImageIDyet, so Context Service exited with "context-service container image digest is unavailable" and the pod restarted once. It now polls every second for up to 30 seconds. API errors still fail immediately, and settingCS_UPLOAD_IMAGEstill skips the lookup (now noted indeploy/context-service.yaml). Tests cover a digest that appears on the third read, timeout, an API error, and cancellation.🤖 Generated with Claude Code