-
Notifications
You must be signed in to change notification settings - Fork 58
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
backends: LXD: don't hardcode eth0 #178
backends: LXD: don't hardcode eth0 #178
Conversation
cc8bf9d
to
a94bca2
Compare
With the ubuntu-22.04 image, the network interface seems to be named "enp5s0" instead of "eth0". To be compatible with both old and new releases, consider any non-loopback interface viable for retrieving an IP address.
a94bca2
to
513f682
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have the exact same change in my branch.
ping @ZeyadYasser, please have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this, would it be a good idea to add a check that the server is reachable by the host through this IP address (using an icmp ping or something similar) before selecting it to avoid a case where there are multiple addresses but one of them is not accessible by the host.
CC: @bboozzoo
Unless the configuration adds another interface explicitly, the container will have |
I'm assuming here that if multiple non- Spread didn't have the restriction of "only a single non- If there are multiple interfaces where only some of them are suitable for Spread to connect via SSH, we probably need additional configuration anyway (and that is probably outside of the scope of this PR). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you!
spread/lxd.go
Outdated
for intf, network := range sjson.State.Network { | ||
if intf == "lo" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change these variable names to match the corresponding chunk in #185?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. There's indeed a question about multiple interfaces, but this looks like at least a good start and solves the common case. Let's see how far we get with it alone.
With the ubuntu-22.04 image, the network interface seems to be sometimes named "enp5s0" instead of "eth0". To be compatible with both old and new releases, consider any non-loopback interface viable for retrieving an IP address.