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

Fix network info for docker containers running with --net=host. #864

Merged
merged 1 commit into from
Aug 24, 2015

Conversation

rjnagal
Copy link
Contributor

@rjnagal rjnagal commented Aug 21, 2015

Docker still reports a loop device for these. Need to check for
more than one device to mark network as available.

@rjnagal
Copy link
Contributor Author

rjnagal commented Aug 21, 2015

@vmarmol This fixes empty network display for kube containers.

spec.HasNetwork = len(config.Networks) > 0
// Docker reports a loop device for containers with --net=host. Ignore
// those too.
spec.HasNetwork = len(config.Networks) > 1
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT if we count the non-loopback devices? If in the future this changes we don't have to worry about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, changed to counting non-loopback devices.

Docker still reports a loop device for these. Need to check for
more than one device to mark network as available.
@vmarmol
Copy link
Contributor

vmarmol commented Aug 24, 2015

LGTM, thanks @rjnagal!

vmarmol added a commit that referenced this pull request Aug 24, 2015
Fix network info for docker containers running with --net=host.
@vmarmol vmarmol merged commit 27fb6d5 into google:master Aug 24, 2015
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