Skip to content

Commit

Permalink
Merge pull request #322 from stgraber/ovn
Browse files Browse the repository at this point in the history
incusd/network/ovn: Wait for port to appear
  • Loading branch information
stgraber authored Dec 21, 2023
2 parents 7527f27 + 93676dd commit 9494ba3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/server/network/driver_ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"time"

"github.com/mdlayher/netx/eui64"
ovsClient "github.com/ovn-org/libovsdb/client"

"github.com/lxc/incus/client"
"github.com/lxc/incus/internal/iprange"
Expand Down Expand Up @@ -3629,14 +3630,14 @@ func (n *ovn) InstanceDevicePortStart(opts *OVNInstanceNICSetupOpts, securityACL
// Retry a few times in case port has not yet allocated dynamic IPs.
for i := 0; i < 5; i++ {
dynamicIPs, err = ovnnb.LogicalSwitchPortDynamicIPs(instancePortName)
if err != nil {
if err == nil {
if len(dynamicIPs) > 0 {
break
}
} else if err != ovsClient.ErrNotFound {
return "", nil, err
}

if len(dynamicIPs) > 0 {
break
}

time.Sleep(100 * time.Millisecond)
}

Expand Down

0 comments on commit 9494ba3

Please sign in to comment.