Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
moby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
emulab
moby
Commits
290b1973
Commit
290b1973
authored
11 years ago
by
Solomon Hykes
Browse files
Options
Downloads
Patches
Plain Diff
Fix a bug which caused creation of empty images (and volumes) to crash. FIxes #995.
parent
ecd1fff9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
archive.go
+3
-1
3 additions, 1 deletion
archive.go
image.go
+5
-3
5 additions, 3 deletions
image.go
with
8 additions
and
4 deletions
archive.go
+
3
−
1
View file @
290b1973
...
...
@@ -108,7 +108,9 @@ func TarFilter(path string, compression Compression, filter []string) (io.Reader
// identity (uncompressed), gzip, bzip2, xz.
// FIXME: specify behavior when target path exists vs. doesn't exist.
func
Untar
(
archive
io
.
Reader
,
path
string
)
error
{
if
archive
==
nil
{
return
fmt
.
Errorf
(
"Empty archive"
)
}
bufferedArchive
:=
bufio
.
NewReaderSize
(
archive
,
10
)
buf
,
err
:=
bufferedArchive
.
Peek
(
10
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
image.go
+
5
−
3
View file @
290b1973
...
...
@@ -92,9 +92,11 @@ func StoreImage(img *Image, layerData Archive, root string, store bool) error {
defer
file
.
Close
()
layerData
=
file
}
if
err
:=
Untar
(
layerData
,
layer
);
err
!=
nil
{
return
err
// If layerData is not nil, unpack it into the new layer
if
layerData
!=
nil
{
if
err
:=
Untar
(
layerData
,
layer
);
err
!=
nil
{
return
err
}
}
return
StoreSize
(
img
,
root
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment