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

Fetch container IPs directly from the namespace instead of calling 'weave ps' #3207

Merged
merged 6 commits into from
Jun 4, 2018

Conversation

bboreham
Copy link
Collaborator

@bboreham bboreham commented Jun 2, 2018

Instead of shelling out to weave ps, we do what it was doing - enter the container's namespace and report IPs found there. And whereas weave ps took great pains to report only Weave Net addresses, in Scope we want all addresses, so the code is simpler.

Fixes #2586
Will probably improve #3082

We can't remove the weave script or weaveutil program from the container as the App is still using them to do weave expose.

bboreham added 5 commits June 2, 2018 21:45
We will use them to fetch IP addresses from container namespaces

Required an update to golang.org/x/sys/unix
So that we can rely on the fix to runtime.LockOSThread()
So that we can pick up addresses added via CNI or other mechanisms
that Docker is not aware of.
Now that we enter the container namespace to fetch IPs for every
container, there is no need to have 'weave ps' do it.

This does mean we lose Weave MAC addresses, but that is a rather
idiosyncratic feature anyway.
}
for _, cidr := range cidrs {
ip := cidr.IP.String()
if !contains(ips, ip) {

This comment was marked as abuse.

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.

2 participants