Skip to content

Commit f3c5f4f

Browse files
dmcgowanruncom
authored andcommitted
Cleanup invalid code in overlay2 and layer store
The overlay2 change ensures that the correct path is used to resolve the symlink. The current code will not fail since the symlinks are always given a value of "../id/diff" which ends up ignoring the incorrect "link" value. Fix this code so it doesn't cause unexpected errors in the future if the symlink changes. The layerstore cleanup ensures that the empty layer returns a tar stream if the provided parent is empty. Any value other than empty still returns an error since the empty layer has no parent. Currently empty layer is not used anywhere that TarStreamFrom is used but could break in the future if this function is called. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
1 parent 1533b68 commit f3c5f4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

daemon/graphdriver/overlay2/overlay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ func (d *Driver) getLowerDirs(id string) ([]string, error) {
429429
if err != nil {
430430
return nil, err
431431
}
432-
lowersArray = append(lowersArray, path.Clean(path.Join(d.home, "link", lp)))
432+
lowersArray = append(lowersArray, path.Clean(path.Join(d.home, linkDir, lp)))
433433
}
434434
} else if !os.IsNotExist(err) {
435435
return nil, err

0 commit comments

Comments
 (0)