-
Notifications
You must be signed in to change notification settings - Fork 645
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
Network aliases management #1000
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1000 +/- ##
============================================
+ Coverage 51.8% 51.85% +0.04%
- Complexity 1365 1393 +28
============================================
Files 147 147
Lines 7460 7548 +88
Branches 1132 1146 +14
============================================
+ Hits 3865 3914 +49
- Misses 3229 3263 +34
- Partials 366 371 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR ! Could you please check your whitespace settings, the diff is by far too large. Looks like you've introduced tabs (we dont use tabs). I can see the really diff with the "No Whitespace" button, but then I can't comment on the PR.
Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed tabs to spaces.
Sorry for my wrong settings ;-(
Thanks ! but not sure what going on, as when I select https://github.com/fabric8io/docker-maven-plugin/pull/1000/files I still see that everything has changed. Could you try to squash your commits to one and force push it ? thanks ! |
I don't know what is really going on: 0e05cc9 I'll squash everything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files committed with right settings.
@rhuss Is it possible to merge the PR ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. looks good except that I would not use the implementation classes but the interfaces when looking up the aliases in various different ways.
for (String alias : (List<String>) aliases) { | ||
ret.addAlias(alias); | ||
} | ||
} else if (aliases instanceof LinkedHashMap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be better to check just for Map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely right
ret.addAlias(alias); | ||
} | ||
} else if (aliases instanceof LinkedHashMap) { | ||
LinkedHashMap<String, ArrayList<String>> map = (LinkedHashMap<String, ArrayList<String>>) aliases; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map<String,List<String>> map
because using the implementation classes as type parameters really causes a tight coupling and you really don't need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right again
} | ||
} else { | ||
throwIllegalArgumentException( | ||
"'networks:' Aliases must be given as a linked has map of strings. 'aliases' key not founded"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does it have to be a LinkedHashMap ? Just a "... as a map of strings", so I would use this error message:
'networks:' No aliases entry found in network config map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Message updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good.
Hi all,
I had some problems to start an external docker-compose.yml because of network aliases configuration mismatch.
The DockerComposeServiceWrapper does not manage correctly the network name nor the aliases.
There is a unit test, the changes and a docker-compose file to check the behaviour.
Regards Gianluca.