mz822: fold resolved heredoc contents into COPY/ADD cache key#823
Open
mzihlmann wants to merge 5 commits into
Open
mz822: fold resolved heredoc contents into COPY/ADD cache key#823mzihlmann wants to merge 5 commits into
mzihlmann wants to merge 5 commits into
Conversation
ee68ef7 to
404f6c0
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
deeaa3b to
ac6196c
Compare
ac6196c to
044e236
Compare
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.
Fixes #822
Stacked on #817 and #791, the only new commit is the last one (the earlier commits are cherry-picks of those two PRs and should land first).
A COPY or ADD heredoc body can reference build args once it is expanded, but the layer cache key is built from the instruction text, which omits the heredoc body. A build that changes only an arg referenced inside a body reused the layer cached for a different resolved content and served a stale file. The resolved heredoc contents are now folded into the COPY/ADD cache key under
FF_KANIKO_RESOLVE_CACHE_KEY, the same flag and resolution#791introduced for instruction paths, so the key tracks exactly the variables the body references. Resolution touches no files, so the cache-lookahead precompute derives the same key as the build.