fix(api): preserve registry ports in package images#280
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR refines image tag and digest handling in the Skyhook API. A new Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@operator/api/v1alpha1/skyhook_webhook_test.go`:
- Around line 581-594: Add test cases exercising digest parsing: extend the JSON
in the It("packages should preserve registry ports when stripping image tags",
...) test to include entries like "baz":
{"version":"1.2.2","image":"localhost:5000/org/pkg@sha256:abcdef..."} and "qux":
{"version":"1.2.2","image":"localhost:5000/org/pkg:1.2.2@sha256:abcdef..."} (use
a realistic sha256 hex), unmarshal into Packages (ret) and add assertions that
ret["baz"].Name == "baz" and ret["baz"].Image ==
"localhost:5000/org/pkg@sha256:abcdef..." and that ret["qux"].Name == "qux" and
ret["qux"].Image == "localhost:5000/org/pkg@sha256:abcdef..." so the digest
branch behavior in the image parsing (Packages -> Image) is covered while
preserving registry ports.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 3b49d0ef-4373-4fbb-920f-6a0ce34b1f45
📒 Files selected for processing (3)
operator/api/v1alpha1/skyhook_types.gooperator/api/v1alpha1/skyhook_webhook.gooperator/api/v1alpha1/skyhook_webhook_test.go
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
2007c6a to
440330c
Compare
Summary
localhost:5000/org/pkgduring package image defaulting.Why
Package image handling split on the first colon, so a registry port was mistaken for a tag. That truncated valid package images like
localhost:5000/org/pkgtolocalhostand made validation treat5000/org/pkgas the image tag.Validation
go test ./api/v1alpha1go test ./...