Fix IPXEBootConfig URLs for digest-based image references#329
Conversation
71cfa24 to
e558878
Compare
|
Warning Review limit reached
More reviews will be available in 49 minutes and 33 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR consolidates image URL generation for iPXE boot configs. A new ChangesDigest URL encoding consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
e558878 to
a2fa098
Compare
a2fa098 to
b2fbc19
Compare
b2fbc19 to
5fc6326
Compare
The old strings.Split(image, ":") code split a digest reference like registry/org/image@sha256:<hash> at the colon, producing a malformed imageName=...@sha256&version=<hash> in the stored URL, causing HTTP 400 errors during iPXE boot. Switch URL construction to use url.Values.Encode() so query parameters are properly percent-encoded, and add V(1) log lines for specImage, imageName, imageVersion, and the three built URLs to aid future debugging. Fixes #328 Signed-off-by: Konstantin Koslowski <konstantin.koslowski@sap.com>
5fc6326 to
563ee22
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/controller/serverbootconfig_helpers.go (1)
68-77: Query parameter keys match the server parser (imageName,layerDigest,version)
buildImageURLsetsimageName,version, andlayerDigest, andparseImageURLusesimageKey="imageName",versionKey="version", andlayerDigestKey="layerDigest"to read them; the helper test also asserts these exact query keys. The only mismatch is the error string ('image'/'layer'/'version') which is misleading—consider aligning it with the actual parameter names.🤖 Prompt for 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. In `@internal/controller/serverbootconfig_helpers.go` around lines 68 - 77, The error messages in parseImageURL use generic labels ('image'/'layer'/'version') that don't match the actual query parameter keys set by buildImageURL (imageName, version, layerDigest) and the helper test; update the error strings in parseImageURL (and any related test expectations) to reference the exact parameter names imageName, layerDigest, and version so they align with buildImageURL, the parser keys (imageKey, versionKey, layerDigestKey), and the helper test assertions.
🤖 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.
Nitpick comments:
In `@internal/controller/serverbootconfig_helpers.go`:
- Around line 68-77: The error messages in parseImageURL use generic labels
('image'/'layer'/'version') that don't match the actual query parameter keys set
by buildImageURL (imageName, version, layerDigest) and the helper test; update
the error strings in parseImageURL (and any related test expectations) to
reference the exact parameter names imageName, layerDigest, and version so they
align with buildImageURL, the parser keys (imageKey, versionKey,
layerDigestKey), and the helper test assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 46d51669-83c0-452e-95d9-a4ac537c134b
📒 Files selected for processing (3)
internal/controller/serverbootconfig_helpers.gointernal/controller/serverbootconfig_helpers_test.gointernal/controller/serverbootconfiguration_pxe_controller.go
Signed-off-by: Konstantin Koslowski <konstantin.koslowski@sap.com>
Summary
strings.Split(image, ":")code split a digest reference likeregistry/org/image@sha256:<hash>at the colon, producingimageName=...@sha256&version=<hash>in the storedIPXEBootConfigURL, causing HTTP 400 errors during iPXE booturl.Values.Encode()so query parameters are properly percent-encodedspecImage,imageName,imageVersion, and the three built URLs to aid future debuggingFixes #328
Test plan
go test ./internal/controller/ -run TestImageURLFromSpecImage— verifies all three layer URLs have correctimageName,version(withsha256:prefix), andlayerDigestparameters for a long-hostname digest referenceSummary by CodeRabbit
New Features
Bug Fixes
Tests