GEP-33 addition : fix image metadata read #33
Conversation
|
Warning Review limit reached
More reviews will be available in 44 minutes and 11 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn ChangesOCI Manifest Metadata Fallback
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cloudprofilesync/source.go`:
- Around line 157-160: The error message in the fmt.Errorf call for the
architecture lookup is outdated and misleading. Since the meta lookup now
includes both annotations and labels (not just annotations), update the error
message in the line where architecture is checked to accurately reflect that the
architecture annotation or label was not found, rather than claiming only the
annotation is missing. This will provide accurate context during debugging and
triage.
- Around line 153-165: The metadata lookup is using per-map fallback where
either manifest.Annotations or manifest.Labels is selected upfront and reused
for all subsequent key lookups. This fails when metadata keys are split across
both maps (e.g., architecture in labels but feature_set in annotations), causing
valid images to be incorrectly rejected. Change the approach to per-key lookup:
instead of assigning a single meta map and reusing it, check both
manifest.Annotations and manifest.Labels independently for each key access
("architecture", "feature_set", "version") so that keys can be found regardless
of which map they reside in.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 401280d3-f99f-4098-9224-a01238257414
📒 Files selected for processing (1)
cloudprofilesync/source.go
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
|
wrong idea |
Read metadata not only from annotations, but from labels too
example image manifest : https://github.com/gardenlinux/gardenlinux-sci/pkgs/container/gardenlinux-ccloud/453780162?tag=1921.0.0-metal-sci-usi-amd64-1921.0-4cde331e-amd64
Summary by CodeRabbit