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

Add fallback to resolveSystemAddr() in linux #26457

Merged
merged 1 commit into from
Sep 10, 2016
Merged

Add fallback to resolveSystemAddr() in linux #26457

merged 1 commit into from
Sep 10, 2016

Conversation

aboch
Copy link
Contributor

@aboch aboch commented Sep 9, 2016

  • This PR is to address an issue with the swarm init address autodiscovery when the docker daemon is running inside a container.
    The issue (which was introduced by Only consider netlink "device" interfaces in address autodetection on Linux #25279) is that docker will always prompt the user to pass the advertise-addr option even when it should not be needed (only one ethernet interface present).
  • The problem happens because in a container the ethernet interfaces are in fact veth interfaces, therefore the current logic would skip them, given it only looks for device type interfaces.
  • The fix to cover this corner case is to have the linux auto-address logic fall back to the common auto-address logic being used in the other platforms, when no device type interface is found. The common autoaddress logic filtering relies on checking whether the prospect interface's address is not part of the subnets docker manages.

Signed-off-by: Alessandro Boch aboch@docker.com

- So that swarm init will still work w/o specifying the advertise
  address when the daemon is running inside a container

Signed-off-by: Alessandro Boch <aboch@docker.com>
@aboch
Copy link
Contributor Author

aboch commented Sep 9, 2016

ping @aaronlehmann

@aaronlehmann
Copy link
Contributor

Tested and it works for me.

LGTM

@tonistiigi
Copy link
Member

LGTM

@cpuguy83 cpuguy83 merged commit ebae43e into moby:master Sep 10, 2016
@thaJeztah thaJeztah added this to the 1.13.0 milestone Sep 22, 2016
@aboch aboch deleted the auto branch November 8, 2017 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants