diff --git a/spread/lxd.go b/spread/lxd.go index 2cbf9974..13e5d7dd 100644 --- a/spread/lxd.go +++ b/spread/lxd.go @@ -443,9 +443,15 @@ func (p *lxdProvider) address(name string) (string, error) { if err != nil { return "", err } - for _, addr := range sjson.State.Network["eth0"].Addresses { - if addr.Family == "inet" && addr.Address != "" { - return addr.Address, nil + for intf, network := range sjson.State.Network { + if intf == "lo" { + continue + } + for _, addr := range network.Addresses { + debugf("considering interface %v\n", intf) + if addr.Family == "inet" && addr.Address != "" { + return addr.Address, nil + } } } return "", &lxdNoAddrError{name} diff --git a/tests/lxd/spread.yaml b/tests/lxd/spread.yaml index cb46b05d..37ddb2e5 100644 --- a/tests/lxd/spread.yaml +++ b/tests/lxd/spread.yaml @@ -4,6 +4,9 @@ backends: lxd: systems: - ubuntu-16.04 + - ubuntu-18.04 + - ubuntu-20.04 + - ubuntu-22.04 path: /home/test