Ignore sockets when creating a tar stream of a layer#2222
Merged
dmcgowan merged 2 commits intocontainerd:masterfrom Mar 22, 2018
Merged
Ignore sockets when creating a tar stream of a layer#2222dmcgowan merged 2 commits intocontainerd:masterfrom
dmcgowan merged 2 commits intocontainerd:masterfrom
Conversation
The go-tar implementation which is used cannot handle sockets. There's no good reason to preserve a socket, they are basically useless without the process which made them. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
Contributor
Author
|
If accepted would be good to have this in v1.0.x too I think. |
Codecov Report
@@ Coverage Diff @@
## master #2222 +/- ##
==========================================
+ Coverage 41.06% 41.09% +0.02%
==========================================
Files 66 66
Lines 7748 7751 +3
==========================================
+ Hits 3182 3185 +3
- Misses 4064 4065 +1
+ Partials 502 501 -1
Continue to review full report at Codecov.
|
Member
|
LGTM Would it be possible to create a test? Also, let’s backport this one. |
Contributor
Author
|
I'll have a look at a test now, I've got about 25 mins left today so it might be tomorrow before it is done. |
ijc
pushed a commit
to ijc/continuity
that referenced
this pull request
Mar 22, 2018
I need this in order to test containerd/containerd#2222 Signed-off-by: Ian Campbell <ijc@docker.com>
ijc
pushed a commit
to ijc/continuity
that referenced
this pull request
Mar 22, 2018
I need this in order to test containerd/containerd#2222 Signed-off-by: Ian Campbell <ijc@docker.com>
ijc
pushed a commit
to ijc/continuity
that referenced
this pull request
Mar 22, 2018
I need this in order to test containerd/containerd#2222 Signed-off-by: Ian Campbell <ijc@docker.com>
Contributor
Author
|
I have a test now, but it depends on containerd/continuity#110. It looks like: diff --git a/archive/tar_test.go b/archive/tar_test.go
index 4d56d4e2..c94c9d37 100644
--- a/archive/tar_test.go
+++ b/archive/tar_test.go
@@ -1022,6 +1022,22 @@ func TestDiffTar(t *testing.T) {
fstest.CreateDir("/d3/", 0755),
),
},
+ {
+ name: "IgnoreSockets",
+ validators: []tarEntryValidator{
+ fileEntry("f2", []byte("content"), 0644),
+ // There should be _no_ socket here, despite the fstest.CreateSocket below
+ fileEntry("f3", []byte("content"), 0644),
+ },
+ a: fstest.Apply(
+ fstest.CreateFile("/f1", []byte("content"), 0644),
+ ),
+ b: fstest.Apply(
+ fstest.CreateFile("/f2", []byte("content"), 0644),
+ fstest.CreateSocket("/s0", 0644),
+ fstest.CreateFile("/f3", []byte("content"), 0644),
+ ),
+ },
}
for _, at := range tests { |
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
mlaventure
approved these changes
Mar 22, 2018
Member
|
LGTM |
Contributor
Author
|
Awesome, thanks for sorting the test! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The go-tar implementation which is used cannot handle sockets.
There's no good reason to preserve a socket, they are basically useless without
the process which made them.
Signed-off-by: Ian Campbell ian.campbell@docker.com
I discovered this with https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp and buildkit's dockerfile frontend which gave:
While a
docker buildworks.