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

[service discovery] fix fallback IP address extraction #2855

Merged
merged 1 commit into from
Sep 19, 2016

Conversation

hkaj
Copy link
Member

@hkaj hkaj commented Sep 19, 2016

Note: Please remember to review the Datadog Contribution Guidelines
if you have not yet done so.

What does this PR do?

When no key (network name or id) was passed to the host variable, we used to skip the _get_fallback_ip method and only try using the Config.NetworkSettings.IPAddress address (which is empty more often than not now). With this PR, _get_fallback_ip applies every time, using the bridge network address or the last network (sorted) address.

Motivation

More and more often Config.NetworkSettings.IPAddress is empty, relying on it makes the agent fail in cases where it could infer the config automatically.

Testing Guidelines

Updated the relevant mocks in unit tests

Additional Notes

@hkaj hkaj force-pushed the haissam/sd-default-network-ip branch from 619853a to 97982d1 Compare September 19, 2016 12:44
@masci
Copy link
Contributor

masci commented Sep 19, 2016

LGTM, there was a flaky test, restarted and now it's green. 👍

@truthbk truthbk added this to the 5.9.0 milestone Sep 19, 2016
@truthbk truthbk merged commit a67b9f9 into master Sep 19, 2016
@truthbk truthbk deleted the haissam/sd-default-network-ip branch September 19, 2016 22:39
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.

3 participants