Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make crane export more ergonomic #1203

Merged
merged 1 commit into from
Dec 14, 2021
Merged

Make crane export more ergonomic #1203

merged 1 commit into from
Dec 14, 2021

Conversation

jonjohnsonjr
Copy link
Collaborator

Default second arg to stdout so I don't have to type "-".

For images with a single layer, avoid calling mutate.Extract to flatten
the filesystem, instead we just write the uncompressed bytes to stdout.
In order to make that work, partial.Compressed now actually detects
whether the payload is gzipped or not when calling Uncompressed instead of just
assuming all blobs are compressed (and failing).

Fixes #1150

Default second arg to stdout so I don't have to type "-".

For images with a single layer, avoid calling mutate.Extract to flatten
the filesystem, instead we just write the uncompressed bytes to stdout.
In order to make that work, partial.Compressed now actually detects
whether the payload is gzipped or not when calling Uncompressed instead of just
assuming all blobs are compressed (and failing).
@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2021

Codecov Report

Merging #1203 (3fa962b) into main (c75901c) will decrease coverage by 0.20%.
The diff coverage is 40.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1203      +/-   ##
==========================================
- Coverage   74.76%   74.55%   -0.21%     
==========================================
  Files         111      111              
  Lines        8008     8050      +42     
==========================================
+ Hits         5987     6002      +15     
- Misses       1441     1464      +23     
- Partials      580      584       +4     
Impacted Files Coverage Δ
internal/gzip/zip.go 72.72% <0.00%> (-17.60%) ⬇️
pkg/v1/partial/compressed.go 70.83% <57.14%> (-4.17%) ⬇️
pkg/crane/export.go 68.42% <62.50%> (-31.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c75901c...3fa962b. Read the comment docs.

Copy link
Collaborator

@imjasonh imjasonh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@imjasonh imjasonh merged commit a65b784 into google:main Dec 14, 2021
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.

Q: easier way to grab/read a layer?
3 participants