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

Check errors in docker_discovery.go #41

Merged
merged 5 commits into from
Nov 19, 2018

Conversation

mihaitodor
Copy link

@mihaitodor mihaitodor commented Nov 6, 2018

Looks like we're missing some error checks in there and we should keep on retrying to connect even if d.ClientProvider() fails the first time.

Also, the for loop in manageConnection was calling docker.NewClient(d.endpoint) instead of d.ClientProvider(), which seems wrong to me, because d.ClientProvider() resolves to d.getDockerClient(), which is able to call docker.NewClientFromEnv(), in case d.endpoint == "".

I also fixed a flaky test in static_discovery.

TODO:

  • Figure out why it sometimes crashes when restarting Docker with panic: send on closed channel at vendor/github.com/fsouza/go-dockerclient/event.go:344

@mihaitodor mihaitodor requested review from sbz and relistan November 6, 2018 14:33
@mihaitodor mihaitodor force-pushed the mihaitodor/check-errors-docker-discovery branch from 76fa941 to 97c6474 Compare November 6, 2018 14:40
Copy link
Collaborator

@relistan relistan left a comment

Choose a reason for hiding this comment

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

Looks like a good fix overall. Some comments above.

discovery/docker_discovery.go Show resolved Hide resolved
discovery/docker_discovery.go Outdated Show resolved Hide resolved
discovery/docker_discovery_test.go Outdated Show resolved Hide resolved
discovery/docker_discovery_test.go Outdated Show resolved Hide resolved
@mihaitodor mihaitodor force-pushed the mihaitodor/check-errors-docker-discovery branch from 97c6474 to cc22ed3 Compare November 10, 2018 21:47
@mihaitodor
Copy link
Author

@relistan I addressed your comments, thanks! I also addressed the TODO in #42.

@relistan
Copy link
Collaborator

One minor thing, then :shipit:

@mihaitodor mihaitodor force-pushed the mihaitodor/check-errors-docker-discovery branch from cc22ed3 to 804f4d8 Compare November 19, 2018 11:28
@mihaitodor mihaitodor merged commit 3ed7ddc into master Nov 19, 2018
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