Skip to content
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

#391: remember service map from all docker compose files #392

Merged

Conversation

ank-n
Copy link
Contributor

@ank-n ank-n commented Dec 15, 2021

Fixes #391

I added a new docker-compose file with postgres image. Hope thats okay.
Without this fix, services field keeps map for only the last docker-compose file passed. But there could be service that are not overridden in the last file, and it should keep those values in the map.

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #392 (4f808bd) into master (f4ad58c) will decrease coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #392      +/-   ##
==========================================
- Coverage   63.35%   63.27%   -0.09%     
==========================================
  Files          16       16              
  Lines        1067     1070       +3     
==========================================
+ Hits          676      677       +1     
- Misses        290      291       +1     
- Partials      101      102       +1     
Impacted Files Coverage Δ
compose.go 75.18% <100.00%> (+0.55%) ⬆️
docker.go 65.68% <0.00%> (-0.40%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4ad58c...4f808bd. Read the comment docs.

Comment on lines +201 to +206
if dc.Services == nil {
dc.Services = c.Services
} else {
for k, v := range c.Services {
dc.Services[k] = v
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ankan-pfc thank you for the fix! It was there looking at us without being noticed :)

LGTM

@mdelapenya mdelapenya self-assigned this Dec 15, 2021
@mdelapenya mdelapenya merged commit cdd4aba into testcontainers:master Dec 15, 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.

Creating containers with multiple docker compose file does not returns correct map of services
2 participants