Fix the timestamp bug in pulling a multi layer image.#832
Merged
Conversation
Contributor
Author
|
WIP: Working on adding a test for this by creating a new image with 2 layers and pushing it to docker hub. Would like to get the code changes reviewed until then. |
kevpar
reviewed
Jun 5, 2020
76e76e9 to
948edaa
Compare
When pulling a multilayer image, the delta layers can delete some files or create new hard links. We have to do this file deletion or hard link creation after we are done with the ImportLayer call. However, these operations alter the last modification timestamps of the parent directories of these files. Some container applications depend on these timestamps and these applications don't work as expected when we delete the files or create hardlinks. This change reverts the timestamps after doing the delete or hard link creation operation so that the container applications depending on them aren't affected. Also, until now we only did this for files that aren't symlinks, with this change we will do it for files that are symlinks too. This had to be done because while exporting a layer we sometimes incorrectly adds the symlink attribute to a directory that isn't actually a symlink. Signed-off-by: Amit Barve <ambarve@microsoft.com>
948edaa to
945b220
Compare
jstarks
approved these changes
Jun 9, 2020
princepereira
pushed a commit
to princepereira/hcsshim
that referenced
this pull request
Aug 29, 2024
Fix the timestamp bug in pulling a multi layer image.
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.
When pulling a multilayer image, the delta layers can delete some files or create new hard links. We have to do this file deletion or hard link creation after we are done with the ImportLayer call. However, these operations alter the last modification timestamps of the parent directories of these files. Some container applications depend on these timestamps and these applications don't work as expected when we delete the files or create hardlinks. This change reverts the timestamps after doing the delete or hard link creation operation so that the container applications depending on them aren't affected.
Signed-off-by: Amit Barve ambarve@microsoft.com
The github issue tracking this is here: #830