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

[docker] Fall back to default route if docker hostname is not resolvable #2753

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

remh
Copy link

@remh remh commented Aug 12, 2016

What does this PR do?

In case, the agent cannot resolve the docker host hostname, we fall back on the default gateway.

Motivation

Customer ticket on kubernetes where the agent was unable to resolve the docker host hostname.

@remh remh added this to the 5.9.0 milestone Aug 12, 2016
@remh
Copy link
Author

remh commented Aug 12, 2016

@truthbk @hkaj to be merged before #2702 (as it's merging into Haissam's branch)

@truthbk
Copy link
Member

truthbk commented Aug 12, 2016

Related: #2745

for line in f.readlines():
fields = line.strip().split()
if fields[1] == '00000000':
return socket.inet_ntoa(struct.pack('<L', int(fields[2], 16)))
Copy link
Member

@truthbk truthbk Aug 12, 2016

Choose a reason for hiding this comment

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

We might need some fallback for ipv6 only systems... not sure how /proc/net/route would look in those cases. The file might even be ipv4-only given the format documented.

Copy link
Author

Choose a reason for hiding this comment

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

This is to be run within a Docker container which doesn't support ipv6 only networks

@truthbk
Copy link
Member

truthbk commented Aug 12, 2016

Other than the ipv6 concern, this looks good to me 👍

@remh remh merged commit 7ab3fc4 into haissam/fine-grained-reload Aug 12, 2016
@remh remh deleted the remh/k8s-fix branch August 12, 2016 22:11
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.

2 participants