Skip to content

Conversation

@tkdchen
Copy link
Contributor

@tkdchen tkdchen commented Apr 24, 2024

This PR proposes a new extra-src file name form.

There is a use case for source container images with extra sources. That is, after deduplicating sources between two images then merge them, same extra source tar archive names remain potentially.

For instance, image A has extra-src-[012].tar archive per layer and image B has extra-src-[01].tar archive per layer. When extra-src-1.tar of image B duplicates the extra-src-2.tar of image A and is removed, then after merging these two images, the final source image will have two layers including extra-src-0.tar.

As a result, if users extract the sources sequentially, previous extra-src-*.tar file may be overwritten.

This patch replaces the counter with checksum computed from the extra source archive to avoid such potential duplicate. It is convenient for manipulate sources by image layers directly without the need of adjusting the counter.

There is a use case for source container images with extra sources. That is,
after deduplicating sources between two images then merge them, same
extra source tar archive names remain potentially.

For instance, image A has extra-src-[012].tar archive per layer and
image B has extra-src-[01].tar archive per layer. When extra-src-1.tar
of image B duplicates the extra-src-2.tar of image A and is removed,
then after merging these two images, the final source image will have
two layers including extra-src-0.tar.

As a result, if users extract the sources sequentially, previous
extra-src-*.tar file may be overwritten.

This patch replaces the counter with checksum computed from the extra
source archive to avoid such potential duplicate. It is convenient for
manipulate sources by image layers directly without the need of
adjusting the counter.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
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.

1 participant