Make hashes between up and configure consistent#11010
Merged
ndeloof merged 2 commits intodocker:mainfrom Sep 29, 2023
Merged
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11010 +/- ##
==========================================
+ Coverage 57.55% 57.91% +0.36%
==========================================
Files 129 129
Lines 11229 11124 -105
==========================================
- Hits 6463 6443 -20
+ Misses 4136 4047 -89
- Partials 630 634 +4
☔ View full report in Codecov by Sentry. |
ndeloof
approved these changes
Sep 29, 2023
Contributor
|
nice catch! and thanks for investigating this issue |
Signed-off-by: Matthew Walowski <mattwalowski@gmail.com>
Signed-off-by: Matthew Walowski <mattwalowski@gmail.com>
c37d032 to
b773c54
Compare
|
Commit a345515 broke |
Merged
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.
What I did
Currently, when
docker compose config --hash [service]computes a hash for the service, it deletes all other services before computing the hash. That means if a service depends on another service, theDependsOnfield gets deleted, causing the hash to be different than whendocker upcreates the labels.I prevented the dependencies from getting deleted before hash computation to fix this.
I also noticed that
docker updoes some modification to the platform of the image before doing the hash (I.e. if no platform was specified in the yaml file, the default one is set).docker configdoesn't do this at all. So I modifieddocker configto apply these modifications before computing the hash.It could be argued that
configshouldn't callapplyPlatform. Take the scenario where a compose file contains services that don't have a platform specified. If that same file is run on two different machines with different default platforms, the hashes will be different. Personally, I think the hashes for the identical files should be different because they'll run on different platforms, but would love to get some feedback on that.Related issue
Fixes #10907
(not mandatory) A picture of a cute animal, if possible in relation to what you did
