Skip to content

fix: wait for the pod image digest at start-up - #54

Merged
moonlight16 merged 1 commit into
mainfrom
fix/startup-image-digest
Oct 14, 2026
Merged

moonlight16 merged 1 commit into
mainfrom
fix/startup-image-digest

Conversation

@moonlight16

Copy link
Copy Markdown
Member

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 ImageID yet, 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 setting CS_UPLOAD_IMAGE still skips the lookup (now noted in deploy/context-service.yaml). Tests cover a digest that appears on the third read, timeout, an API error, and cancellation.

🤖 Generated with Claude Code

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 evaline-ju left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@moonlight16
moonlight16 merged commit b6fe7de into main Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants