Open
Description
Hi,
Given two structs (generated with -yangpresence=true
flag), the ygot.Diff()
do not diff based on presence or not.
Given the struct below, where AllowImportedVpn
is a presence container, and sending it should set the presence:
*Vrf {
AddressFamily: *Vrf_AddressFamily {
Ipv4: *Vrf_AddressFamily_Ipv4 {
Multicast: *Vrf_AddressFamily_Ipv4_Multicast nil,
Unicast: *Vrf_AddressFamily_Ipv4_Unicast {
Export: *Vrf_AddressFamily_Ipv4_Unicast_Export {
To: *Vrf_AddressFamily_Ipv4_Unicast_Export_To {
DefaultVrf: *Vrf_AddressFamily_Ipv4_Unicast_Export_To_DefaultVrf nil,
Vrf: *Vrf_AddressFamily_Ipv4_Unicast_Export_To_Vrf {
AllowImportedVpn: *Vrf_AddressFamily_Ipv4_Unicast_Export_To_Vrf_AllowImportedVpn {} // <-- This is a presence container
}
}
},
}
},
Description: *"Default",
VrfName: *"TestVRF"
}
}
with this object:
*Vrf {
AddressFamily: *Vrf_AddressFamily {
Ipv4: *Vrf_AddressFamily_Ipv4 {
Multicast: *Vrf_AddressFamily_Ipv4_Multicast nil,
Unicast: *Vrf_AddressFamily_Ipv4_Unicast {
Export: *Vrf_AddressFamily_Ipv4_Unicast_Export {
To: nil. // <-- Presence container is nil
},
}
},
Description: *"Default",
VrfName: *"TestVRF"
}
}
where the entire To
key is set to nil
, creates no diff. As far as I understand, this should remove the presence, and therefor create an Update-entry?
Here's the YANG model: https://github.com/YangModels/yang/blob/main/vendor/cisco/xr/772/Cisco-IOS-XR-um-router-bgp-cfg.yang#L565C1-L571
Metadata
Metadata
Assignees
Labels
No labels