Skip to content

Fix parent directories not included in tar#1925

Merged
estesp merged 1 commit intocontainerd:masterfrom
dmcgowan:parent-directory-inclusion
Dec 15, 2017
Merged

Fix parent directories not included in tar#1925
estesp merged 1 commit intocontainerd:masterfrom
dmcgowan:parent-directory-inclusion

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Actually fixes #1723

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1925 into master will decrease coverage by 0.06%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1925      +/-   ##
==========================================
- Coverage   47.26%   47.19%   -0.07%     
==========================================
  Files          91       91              
  Lines        8962     8964       +2     
==========================================
- Hits         4236     4231       -5     
- Misses       4028     4033       +5     
- Partials      698      700       +2
Flag Coverage Δ
#linux 50.54% <0%> (-0.03%) ⬇️
#windows 42.02% <0%> (-0.06%) ⬇️
Impacted Files Coverage Δ
archive/tar.go 43.25% <0%> (-0.74%) ⬇️
content/local/store.go 50% <0%> (-0.8%) ⬇️

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 afbbe43...d4317a1. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 71d1e55 into containerd:master Dec 15, 2017
@tonistiigi
Copy link
Copy Markdown
Member

tonistiigi commented Dec 18, 2017

This PR breaks the differ in almost all real-world cases, for example, try diffing anything on top of alpine. An error will be produced in https://github.com/containerd/containerd/blob/master/archive/tar.go#L391 because "unmodified" events are generated for paths that don't exist. Based on a quick look the bug is possibly the comparison in

if strings.HasPrefix(updated, makePrefix(last)) {
that doesn't use the right variable(next).

I also found that with the last containerd vendor(from 1.0.0 to master) the diffs contain much more files(even with the commonParents fix) and containers that don't create files don't produce empty diffs but haven't determined if this is related to this PR.

@dmcgowan
Copy link
Copy Markdown
Member Author

@tonistiigi let's put that in a separate issue and sync up on the best way to fix the original issue and the other diff related oddities in one fix. I am not opposed to implementing your originally proposed solution, but I also want to understand how the unmodified entries are causing issues on calls to diff.

@dmcgowan dmcgowan deleted the parent-directory-inclusion branch June 5, 2018 18:20
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.

archive: create parent directory records for diffed files in tar output

5 participants