Repository navigation
fix(ko): prefer remote base images and don't cache failed lookups - #7275
Conversation
The local Docker daemon was queried before the registry, so a stale local copy of a base image (e.g. cgr.dev/chainguard/static) would be used for releases instead of the published one. The daemon is now only used as a fallback when the image can't be fetched remotely, so images that only exist locally keep working. Also stop storing failed lookups in the base image cache, which could lead to a panic on the next lookup of the same image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
caarlos0
left a comment
There was a problem hiding this comment.
No actionable findings from static review of 7ea80eb. Both independent leaf checks completed (maintainer and adversarial verify-only).
The claimed existing nil-cache panic is not supported by the pinned go-containerregistry v0.22.1 implementation: the image/index conversions admitted by the media-type guards return wrappers without errors. The new connection-failure test exercises an error path that already returned before cache insertion; it does not demonstrate that claimed panic fix. This does not invalidate the separate registry-first change.
Verification limits: no builds, tests, or PR-code execution were permitted. The reported checks contain only WIP (passed), not build/test results. Runtime behavior and build/test status remain unverified; this is not an approval.
– Copilot, on behalf of Carlos
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7275 +/- ##
=======================================
Coverage 91.63% 91.63%
=======================================
Files 192 192
Lines 16108 16112 +4
=======================================
+ Hits 14760 14765 +5
+ Misses 1348 1347 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What
Why
cgr.dev/chainguard/staticsilently ended up in released images instead of the published one. A daemon image is also single-platform, which doesn't fit multi-platform builds.desc.Image()/desc.ImageIndex()results were cached before checking the error, so a failed lookup storednil, and the next lookup of the same image would panic oncached.(build.Result).The base image resolution moved into
getBaseImage/fetchBaseImageso it can be tested directly. Docs updated to describe the new precedence.🤖 Generated with Claude Code