fix: Add Dockerfile for digest calculation#9666
fix: Add Dockerfile for digest calculation#9666mattsanta merged 1 commit intoGoogleContainerTools:mainfrom
Conversation
ghost
left a comment
There was a problem hiding this comment.
Hi team,
I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed:
This pull request, authored by AndreasBergmeier6176, aims to improve the digest calculation for images by incorporating Dockerfiles. The intent, as stated in the description, is to fix issue #8226.
Summary of Changes:
The core change is in pkg/skaffold/tag/input_digest.go. Specifically, lines 57-70 were modified to include Dockerfile paths in the digest calculation. The changes ensure that the following are now included:
- Paths from
image.DockerArtifact.DockerfilePath - Paths from
image.KanikoArtifact.DockerfilePath - Paths from
image.CustomArtifact.Dependencies.Dockerfile.Path(if available)
These paths are appended to the srcFiles slice, which is then sorted before being used in the digest calculation. This ensures that the order of files doesn't affect the final digest.
In short: The PR enhances the accuracy of image digest calculation by considering the content of associated Dockerfiles.
And now, a little haiku to lighten the mood:
Dockerfile's might,
Digest now more accurate,
Builds run smoothly on.
404e504 to
3919e84
Compare
|
Could you please update the PR title? - https://www.conventionalcommits.org/en/v1.0.0/ |
|
Thanks for addressing the PR title. Once the linters are passing we can move forward with merging. |
|
Is there anything to be done for linting? The output of these checks are not the most comprehensible IMO. |
f02bc40 to
6c16d91
Compare
Looks like the current linter issue is: |
Previously changes in Dockerfile did not lead to a new artifact being built.
6c16d91 to
5af6738
Compare
* add relative path if missing (dockerfile in different context, probably related to GoogleContainerTools#8226 and PR GoogleContainerTools#9666) * hash filename after content (so it can be compared with md5sum) * trace messages for debugging These changes are handly in cases where the MD5 hash doesn't match. For example, there could be some transformations in remote builders, like git core.autocrlf changing line endings, that were hard to troubleshoot.
* add relative path if missing (dockerfile in different context, probably related to GoogleContainerTools#8226 and PR GoogleContainerTools#9666) * hash filename after content (so it can be compared with md5sum) * trace messages for debugging These changes are handly in cases where the MD5 hash doesn't match. For example, there could be some transformations in remote builders, like git core.autocrlf changing line endings, that were hard to troubleshoot.
Fixes: #8226
Description
inputDigest should now take Dockerfiles into account for digest calculation.