bugfix: remove addresses also when there is a diff, not only when the interface is not present; remove duplicate block of code
This commit is contained in:
@ -448,7 +448,7 @@ class Reconciler:
|
|||||||
for idx, vpp_vxlan in self.vpp.cache["vxlan_tunnels"].items():
|
for idx, vpp_vxlan in self.vpp.cache["vxlan_tunnels"].items():
|
||||||
vpp_ifname = self.vpp.cache["interfaces"][idx].interface_name
|
vpp_ifname = self.vpp.cache["interfaces"][idx].interface_name
|
||||||
config_ifname, config_iface = vxlan_tunnel.get_by_name(self.cfg, vpp_ifname)
|
config_ifname, config_iface = vxlan_tunnel.get_by_name(self.cfg, vpp_ifname)
|
||||||
if not config_iface:
|
if not config_iface or self.__vxlan_tunnel_has_diff(config_ifname):
|
||||||
self.prune_addresses(vpp_ifname, [])
|
self.prune_addresses(vpp_ifname, [])
|
||||||
cli = (
|
cli = (
|
||||||
f"create vxlan tunnel instance {vpp_vxlan.instance} "
|
f"create vxlan tunnel instance {vpp_vxlan.instance} "
|
||||||
@ -457,14 +457,6 @@ class Reconciler:
|
|||||||
self.cli["prune"].append(cli)
|
self.cli["prune"].append(cli)
|
||||||
removed_interfaces.append(vpp_ifname)
|
removed_interfaces.append(vpp_ifname)
|
||||||
continue
|
continue
|
||||||
if self.__vxlan_tunnel_has_diff(config_ifname):
|
|
||||||
cli = (
|
|
||||||
f"create vxlan tunnel instance {vpp_vxlan.instance} "
|
|
||||||
f"src {vpp_vxlan.src_address} dst {vpp_vxlan.dst_address} vni {vpp_vxlan.vni} del"
|
|
||||||
)
|
|
||||||
self.cli["prune"].append(cli)
|
|
||||||
removed_interfaces.append(vpp_ifname)
|
|
||||||
continue
|
|
||||||
config_ifname, config_iface = interface.get_by_name(self.cfg, vpp_ifname)
|
config_ifname, config_iface = interface.get_by_name(self.cfg, vpp_ifname)
|
||||||
if config_iface:
|
if config_iface:
|
||||||
addresses = []
|
addresses = []
|
||||||
|
Reference in New Issue
Block a user