fix(transfer): support Docker manifest media types in OCI-compliant manifest detection#2657
Conversation
✅ Deploy Preview for ocm-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
More reviews will be available in 59 minutes and 17 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 (6)
✨ 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 |
e598f2d to
af3c7a3
Compare
matthiasbruns
left a comment
There was a problem hiding this comment.
conflicts - it works - good job
…anifest detection Docker manifest v2 and manifest list types were excluded from isOCICompliantManifest/IsOCICompliantMediaType, causing LocalBlob resources with Docker manifest media types to silently bypass the OCI artifact upload path during transfer (UploadAsOciArtifact mode). Adds Docker distribution media type constants (documented as mirroring oras-go internal/docker/mediatype.go) and extends the switch in both oci/internal/introspection and transfer/internal to accept them. Adds unit tests for the fixed functions and two graph-level tests verifying Docker LocalBlob routing. Adds an integration test (Test_Integration_TransferDockerManifestLocalBlob_CTFToOCI) that pushes a real Docker v2 manifest, transfers it CTF→OCI with UploadAsOciArtifact, and asserts the target resource has OCIImage access pointing to the target registry. On-behalf-of: @SAP <jakob.moeller@sap.com> Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
The previous test stored raw Docker manifest JSON as a LocalBlob in CTF and tried to run AddOCIArtifact on it, which failed because AddOCIArtifact expects an OCI layout TAR, not raw manifest JSON. Rework to use an OCIImage resource (pointing at a real Docker manifest in a source registry) with CopyModeAllResources + UploadAsOciArtifact. This tests the real scenario: Docker manifest images transferred end-to-end via registry-to-registry copy, landing as OCIImage access in the target. On-behalf-of: @SAP <jakob.moeller@sap.com> Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
af3c7a3 to
7eb35be
Compare
…et with UploadAsOciArtifact With CopyModeAllResources + UploadAsOciArtifact + OCI target, the graph builder takes the streaming path (processOCIArtifactStreaming) which emits TransferOCIArtifact. The previous assertion checked for GetOCIArtifact, which is only emitted when the target is not an OCI repository. Signed-off-by: Jakob Möller <contact@jakob-moeller.com> On-behalf-of: @SAP <jakob.moeller@sap.com>
4c35c1e to
52dbb3d
Compare
What this PR does / why we need it
Docker manifest v2 (
application/vnd.docker.distribution.manifest.v2+json) and Docker manifest list (application/vnd.docker.distribution.manifest.list.v2+json) were excluded fromisOCICompliantManifest/IsOCICompliantMediaTypein bothbindings/go/oci/internal/introspectionandbindings/go/transfer/internal. This caused LocalBlob resources with Docker manifest media types to silently bypass the OCI artifact upload path when usingUploadAsOciArtifactmode during transfer — they were stored as plain local blobs instead.The root cause was a TODO in both functions noting Docker manifests were not yet supported. This PR resolves that TODO by adding the two Docker distribution manifest media type constants (mirroring
oras-go/v2's internal definitions, which are not importable) and extending the switch statements to accept them.Which issue(s) this PR fixes
Internal report: standard
docker manifesttransfer broken in v2 transfer path (UploadAsOciArtifactmode).Testing
How to test the changes
Verification
task testandtask test/integrationif applicable)go workis enabled (seego.work)ocm