fix: add human_friendly_id to 4 schemas for idempotent Repository sync

Add local_identifier attribute (kind: Text) + uniqueness_constraints +
human_friendly_id to InfraVlanVniMapping, InfraEVPNInstance,
InfraMlagInterface and InfraUnderlayLink so Infrahub can perform
upserts during Repository backend sync instead of duplicating objects
on every import.

Schema changes (following the InfraBGPPeerGroup/BGPSession pattern):
- infrahub/schemas/vlan_vxlan.yml: VlanVniMapping + EVPNInstance
- infrahub/schemas/mlag.yml: MlagInterface
- infrahub/schemas/extensions.yml: UnderlayLink

Object file updates:
- 06-vlans-vxlan.yml: local_identifier added to all VlanVniMapping and
  EVPNInstance entries (format: leaf1__vlan40__vni110040 / leaf1__vlan40)
- 12-mlag.yml: InfraMlagInterface section added for all 4 MLAG pairs
  (format: mlag1__leaf1-leaf2)
- 14-fabric-links.yml: InfraUnderlayLink section added for all 16
  spine↔leaf P2P links (format: spine1-eth1__leaf1-eth11)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Damien
2026-03-03 17:19:30 +01:00
parent 370782da62
commit 37b3261416
6 changed files with 262 additions and 8 deletions

View File

@@ -116,19 +116,23 @@ spec:
kind: InfraVlanVniMapping
data:
# VLAN 40 <-> VNI 110040 on leaf1/2/5/6 (L2 VXLAN leafs)
- vtep: ["leaf1"]
- local_identifier: leaf1__vlan40__vni110040
vtep: ["leaf1"]
vlan: ["40"]
vni: ["110040"]
description: "VLAN 40 <-> VNI 110040"
- vtep: ["leaf2"]
- local_identifier: leaf2__vlan40__vni110040
vtep: ["leaf2"]
vlan: ["40"]
vni: ["110040"]
description: "VLAN 40 <-> VNI 110040"
- vtep: ["leaf5"]
- local_identifier: leaf5__vlan40__vni110040
vtep: ["leaf5"]
vlan: ["40"]
vni: ["110040"]
description: "VLAN 40 <-> VNI 110040"
- vtep: ["leaf6"]
- local_identifier: leaf6__vlan40__vni110040
vtep: ["leaf6"]
vlan: ["40"]
vni: ["110040"]
description: "VLAN 40 <-> VNI 110040"
@@ -140,26 +144,30 @@ spec:
data:
# EVPN instance for VLAN 40 on L2 VXLAN leafs
# leaf1: rd 65001:110040, rt both 40:110040
- device: ["leaf1"]
- local_identifier: leaf1__vlan40
device: ["leaf1"]
vlan: ["40"]
route_distinguisher: "65001:110040"
route_target_import: "40:110040"
route_target_export: "40:110040"
redistribute_learned: true
- device: ["leaf2"]
- local_identifier: leaf2__vlan40
device: ["leaf2"]
vlan: ["40"]
route_distinguisher: "65001:110040"
route_target_import: "40:110040"
route_target_export: "40:110040"
redistribute_learned: true
# leaf5/6: rd 65003:110040, rt both 40:110040
- device: ["leaf5"]
- local_identifier: leaf5__vlan40
device: ["leaf5"]
vlan: ["40"]
route_distinguisher: "65003:110040"
route_target_import: "40:110040"
route_target_export: "40:110040"
redistribute_learned: true
- device: ["leaf6"]
- local_identifier: leaf6__vlan40
device: ["leaf6"]
vlan: ["40"]
route_distinguisher: "65003:110040"
route_target_import: "40:110040"