Conversation
|
ping @vbatts |
|
LGTM |
|
moved a defer up a little to a better spot - thanks to @MHBauer for noticing. |
|
So interesting. It seems like we hardly need to do more than just return as if the read is done, but this seems fine. |
|
counting two LGTM's so moved to "merge" |
|
let's wait for the tests to finish first, just want to make sure the move of the defer doesn't break something |
|
@duglin that's why I applied the label, and didn't press the button 👍 |
|
edit: so isn't the bug in |
|
Pulls fine for me: |
|
@tonistiigi I originally had this fix in that func but then the unit tests failed because there are cases where EOF is a valid return value (error cases) and the unit tests were looking for them. So I moved this logic up a level. Not 100% sure this is still the right spot but it did seem to fix it. |
|
This change is better to understand now with all the pools gone but I still doubt it's the correct approach. First, this isn't specific to Other problem is that if the tar was some random garbage less than 10 bytes, then with this fix we would completely ignore the error. My suggestion would be that if If for some reason we want to have exceptions for pull/load etc. but not change the function we should define Also, I'm not sure if we should count empty file as a valid tar's at all. Maybe it's ok to error. Not sure what has caused them in this image. |
|
Removed the "merge" status for now - needs more reviews/work. |
Moved a defer up to a better spot. Fixed TestUntarPathWithInvalidDest to actually fail for the right reason Closes moby#18170 Signed-off-by: Doug Davis <dug@us.ibm.com>
|
@tonistiigi you were correct to push on the validity of the unit testcase. It was passing for the wrong reasons. Once I fixed that ignoring EOF in DecompressStream does seem to work. The test now, correctly, uses an invalid destination and will fail for that reason, not due to the source tar being empty. |
|
LGTM |
|
@tonistiigi thanks for the help |
|
LGTM on the updated fix |
|
LGTM |
|
Thanks so much @duglin ! |
|
@matthughes you're welcome - let me know if it doesn't fix it :-) |
Closes #18170
Add support for loading an image where one layer is empty - literally zero bytes in the tar file, no padding or anything. Not sure how we got into this state, I can't reproduce it, but nevertheless there's an image in Dockerhub like this ( matthughes/library-centos:6-2015.03.20 ) so this makes sure we can load it.
Signed-off-by: Doug Davis dug@us.ibm.com