Skip to content

contenthash: include basename in content checksum for wildcards#2018

Merged
AkihiroSuda merged 1 commit into
moby:masterfrom
tonistiigi:wildcard-copy
Apr 14, 2021
Merged

contenthash: include basename in content checksum for wildcards#2018
AkihiroSuda merged 1 commit into
moby:masterfrom
tonistiigi:wildcard-copy

Conversation

@tonistiigi

@tonistiigi tonistiigi commented Mar 12, 2021

Copy link
Copy Markdown
Member

fixes #2008

While we generally ignore the basename in this layer, for wildcards
there in no other place to add the basename to the checksum as they
can not be resolved earlier. Before the basename that was in the
checksum was the wildcard itself, so if the wildcard remained same,
content remained same but the file where wildcard pointed to was
renamed, the cache was not invalidated.

Unfortunately, this change breaks cache for all copy commands that
use a wildcard.

Signed-off-by: Tonis Tiigi [email protected]

@AkihiroSuda

Copy link
Copy Markdown
Member

needs rebase

@thaJeztah

Copy link
Copy Markdown
Member

@tonistiigi should we cherry-pick this one for v0.8.x ?

While we generally ignore the basename in this layer, for wildcards
there in no other place to add the basename to the checksum as they
can not be resolved earlier. Before the basename that was in the
checksum was the wildcard itself, so if the wildcard remained same,
content remained same but the file where wildcard pointed to was
renamed, the cache was not invalidated.

Unfortunately, this change breaks cache for all copy commands that
use a wildcard.

Signed-off-by: Tonis Tiigi <[email protected]>
@thaJeztah

Copy link
Copy Markdown
Member

@AkihiroSuda @tiborvass @hinshun I see this was rebased; ptal

@AkihiroSuda
AkihiroSuda merged commit c47972d into moby:master Apr 14, 2021
@tonistiigi tonistiigi mentioned this pull request Apr 22, 2021
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.

Not invalidating cache when renaming a file and COPY wildcard

3 participants