-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix composite cache key for multi-stage copy command #1735
Fix composite cache key for multi-stage copy command #1735
Conversation
b511cd5
to
234c691
Compare
…Tools#1706) PR GoogleContainerTools#1518 reintroduced COPY layers caching using the `--cache-copy-layers` flag. Unfortunately, this PR also introduced a bug by not including the stage digest into the caching key of the COPY command when the `--cache-copy-layers` flag was not set. As a result, kaniko would use any previous (possibly stalled) layer from the cache because the digest of the "COPY --from" command would never change. PR author probably expected Go to fallthrough in the switch just like C does. However, this is not the case. Go does not fallthrough in switch-statements by default and requires the fallthrough keyword to be used. Note that this keyword is not available in type-switches though, because it wouldn't work properly with typings.
234c691
to
37bf89f
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Has this regressed in the latest version of kaniko? Since the release of 1.8 I have started to experience the cache layers not detecting repository code changes |
Fixes #1706
Description
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Author note: I did not include an integration test because you'd have to build two different images and check that the two digests differ, which is a quite different paradigm from the existing caching integration tests that always check that the digests match. I thought it would be overkill to design a new integration test system to support such scenario given the use-case is rather specific and the bug itself is kind of dummy. I don't think it'd be worth it.
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.