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

Fix crane append for named pipes #868

Merged
merged 2 commits into from Dec 12, 2020

Conversation

jonjohnsonjr
Copy link
Collaborator

Fixes #707 as well

It's annoying that crane append is hard to use with one-liners, which
is the secret goal of most crane commands. We now stat the layer files
and use a streaming layer for anything that's not a regular file, which
includes named pipes, which fail if we try to open them multiple times.

Now you can do this:

$ crane append -f <(tar -c some-dir/ -f -) -t $IMAGE

It's annoying that `crane append` is hard to use with one-liners, which
is the secret goal of most crane commands. We now stat the layer files
and use a streaming layer for anything that's not a regular file, which
includes named pipes, which fail if we try to open them multiple times.

Now you can do this:

$ crane append -f <(tar -c some-dir/ -f -) -t $IMAGE
@codecov-io
Copy link

codecov-io commented Dec 12, 2020

Codecov Report

Merging #868 (957dda9) into master (94913c0) will decrease coverage by 0.07%.
The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #868      +/-   ##
==========================================
- Coverage   74.33%   74.26%   -0.08%     
==========================================
  Files         106      106              
  Lines        4458     4465       +7     
==========================================
+ Hits         3314     3316       +2     
- Misses        651      655       +4     
- Partials      493      494       +1     
Impacted Files Coverage Δ
pkg/v1/stream/layer.go 79.41% <0.00%> (ø)
pkg/crane/append.go 66.66% <54.54%> (-33.34%) ⬇️
pkg/crane/push.go 100.00% <100.00%> (ø)

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 94913c0...957dda9. Read the comment docs.

@jonjohnsonjr jonjohnsonjr merged commit a85f8fd into google:master Dec 12, 2020
@jonjohnsonjr jonjohnsonjr deleted the crane-append-stream branch December 12, 2020 20:01
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.

Stream layer's reader seems to be closed before it is used
3 participants