Fix resolveUpstreamRef to properly propagate not-found errors#475
Fix resolveUpstreamRef to properly propagate not-found errors#475akesarka wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesImage stream error mapping
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: akesarka The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @akesarka. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
1698d6a to
f02a4b5
Compare
resolveUpstreamRef() was wrapping errors from imageStreamGetter.layers() with ErrImageStreamUnknownErrorCode regardless of the actual error type. When an ImageStream does not exist, layers() returns ErrImageStreamGetterNotFoundCode, which should be converted to ErrImageStreamNotFoundCode using convertImageStreamGetterError() — the same pattern used by every other method in this file. This caused manifestService.Exists() to return HTTP 500 instead of 404 when a HEAD request was made for a manifest in a non-existent ImageStream. Docker Engine 29+ (with containerd image store) issues such HEAD requests before PUT during push, causing image pushes to fail for new ImageStreams that would otherwise be auto-created. Co-authored-by: Cursor <cursoragent@cursor.com>
f02a4b5 to
27ddd45
Compare
Summary
Problem
Docker Engine 29+ (with containerd image store) wraps single-platform images in OCI indexes and issues HEAD requests to check sub-manifest existence before PUT. When the ImageStream does not exist, manifestService.Exists() -> GetImageOfImageStream() -> resolveUpstreamRef() returns ErrImageStreamUnknownErrorCode instead of ErrImageStreamNotFoundCode, causing the registry to respond with HTTP 500 instead of 404.
This prevents the Docker client from proceeding to the manifest PUT, which is where CreateImageStreamMapping() auto-provisions the ImageStream.
Root Cause
resolveUpstreamRef() was the only method in pkg/imagestream/imagestream.go that did not use convertImageStreamGetterError() to translate getter errors. All other methods (ResolveImageID, TagIsInsecure, Exists, localRegistry, IdentifyCandidateRepositories, Tags) already use this pattern.
Test plan
Fixes: https://redhat.atlassian.net/browse/OCPBUGS-99398
Summary by CodeRabbit