-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Alias containers by short id #2746
Conversation
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
LGTM! |
Cherry-picked into #2753 |
|
||
for network in self.networks: | ||
if network in connected_networks: | ||
self.client.disconnect_container_from_network( | ||
container.id, network) |
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.
Do we need to join a network when we create it? or could we just have it join all the networks here?
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.
Yes, we need to set a NetworkMode
or it'll default to bridge
(and we'll just have to disconnect from that). I wondered about setting it to none
, but it's then impossible to connect it to any networks.
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.
Good to know, thanks!
Might be worth making a feature request on engine for a way to accomplish this without connecting to a network originally.
This necessitates a small change in how we connect to networks: rather than setting links and aliases for the one arbitrarily-picked network the container joins on creation, we disconnect and reconnect it immediately after creating it, so that we can set the short-id alias.
Closes #2702.