Retarget hard links pointing to deleted files by emitting the deleted file contents under the first hard link instance. This fixes a breakage in the squashed TAR where we were pointing hard links to missing data.

Fixes https://jira.coreos.com/browse/QUAY-885
This commit is contained in:
Joseph Schorr 2018-03-21 16:05:27 -04:00
parent 041a7fcd36
commit 110366f656
8 changed files with 337 additions and 252 deletions

View file

@ -8,16 +8,16 @@ class TarImageFormatter(object):
"""
def build_stream(self, repo_image, tag, synthetic_image_id, get_image_iterator,
get_layer_iterator):
tar_stream_getter_iterator):
"""
Builds and streams a synthetic .tar.gz that represents the formatted tar created by this class's
implementation.
"""
return GzipWrap(self.stream_generator(repo_image, tag, synthetic_image_id, get_image_iterator,
get_layer_iterator))
tar_stream_getter_iterator))
def stream_generator(self, repo_image, tag, synthetic_image_id, get_image_iterator,
get_layer_iterator):
tar_stream_getter_iterator):
raise NotImplementedError
def tar_file(self, name, contents, mtime=None):