Skip to content

Commit 52a3db0

Browse files
authored
Merge pull request #1818 from stgraber/ovn
incusd/network/common: Handle missing BGP peer
2 parents d081471 + 73f5867 commit 52a3db0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/server/network/driver_common.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package network
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"net"
78
"os"
@@ -13,6 +14,7 @@ import (
1314
incus "github.com/lxc/incus/v6/client"
1415
internalInstance "github.com/lxc/incus/v6/internal/instance"
1516
"github.com/lxc/incus/v6/internal/iprange"
17+
"github.com/lxc/incus/v6/internal/server/bgp"
1618
"github.com/lxc/incus/v6/internal/server/cluster"
1719
"github.com/lxc/incus/v6/internal/server/cluster/request"
1820
"github.com/lxc/incus/v6/internal/server/db"
@@ -699,7 +701,7 @@ func (n *common) bgpClearPeers(config map[string]string) error {
699701
// Remove the peer.
700702
fields := strings.Split(peer, ",")
701703
err := n.state.BGP.RemovePeer(net.ParseIP(fields[0]))
702-
if err != nil {
704+
if err != nil && !errors.Is(err, bgp.ErrPeerNotFound) {
703705
return err
704706
}
705707
}

0 commit comments

Comments
 (0)