Skip to content

Support OCI layout tarballs in crane load#2320

Open
Haihan-Jiang wants to merge 1 commit into
google:mainfrom
Haihan-Jiang:codex/go-containerregistry-oci-tar-load
Open

Support OCI layout tarballs in crane load#2320
Haihan-Jiang wants to merge 1 commit into
google:mainfrom
Haihan-Jiang:codex/go-containerregistry-oci-tar-load

Conversation

@Haihan-Jiang

@Haihan-Jiang Haihan-Jiang commented May 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #2109.

Summary

  • let crane.Load fall back from Docker tarball parsing to single-image OCI layout tarballs
  • safely extract OCI layout tarballs to a temporary directory and materialize the image before cleanup
  • update crane push help text now that non-directory inputs can be Docker or OCI layout tarballs
  • add coverage for loading an OCI layout tarball created from crane.SaveOCI

Testing

  • go test ./pkg/crane -run TestCraneLoadOCILayoutTarball -count=1
  • go test ./pkg/crane ./cmd/crane/cmd -count=1
  • go test ./...

Signed-off-by: Haihan Jiang <haihanj99@gmail.com>
@Haihan-Jiang
Haihan-Jiang marked this pull request as ready for review May 24, 2026 12:32
@Haihan-Jiang

Copy link
Copy Markdown
Contributor Author

This is ready for review. The change lets crane load accept OCI layout tarballs through the existing push path, with coverage in pkg/crane. The visible checks are green.

@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.47059% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.87%. Comparing base (31df54c) to head (61d66a3).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
pkg/crane/push.go 50.74% 19 Missing and 14 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2320      +/-   ##
==========================================
- Coverage   56.91%   56.87%   -0.04%     
==========================================
  Files         165      165              
  Lines       11362    11428      +66     
==========================================
+ Hits         6467     6500      +33     
- Misses       4134     4153      +19     
- Partials      761      775      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/crane/push.go

tr := tar.NewReader(f)
for {
header, err := tr.Next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crane: push command erroring with "file manifest.json not found in tar"

3 participants