Repository navigation
Conversation
c9524c1 to
6b5a84d
Compare
Implements EnsureDHCPRelay and DeleteDHCPRelay for the SR Linux provider using native Nokia YANG models. Supports per-subinterface relay and optional cross-VRF forwarding via vrfRef. Signed-off-by: Vasyl Paliuha <vasyl.paliuha@sap.com>
Signed-off-by: Vasyl Paliuha <vasyl.paliuha@sap.com>
fbfb3a6 to
4c953d6
Compare
felix-kaestner
left a comment
There was a problem hiding this comment.
How did you test your implementation given that the Nokia SRLinux provider currently supports neither the Interface or the VRF/NetworkInstance configuration? Both are a prerequisite for even being able to configure a dhcprelay.
| } | ||
|
|
||
| func (d *DHCPRelay) XPath() string { | ||
| return fmt.Sprintf("srl_nokia-interfaces:interface[name=%s]/subinterface[index=%d]/ipv4/srl_nokia-interfaces-ip-dhcp-relay:dhcp-relay", d.Interface, d.SubinterfaceIndex) |
There was a problem hiding this comment.
We need to make sure that as this is a subtree of the YANG tree of the interface itself, that when we implement the interface provider for native Nokia SRLinux later, that we don't use a gnmiext.Update to replace the configuration of an interface, as that would then also overwrite whatever we set here in a nested path. Therefore the interface provider implementation must use Patch() calls only to update the interface tree.
Both are already covered in the PR description under the Testing section:
Testing relies on workarounds, and VRF in particular cannot be tested end-to-end without a working provider. In hindsight, this should have been implemented after the Interface and VRF providers. I'd suggest freezing this PR until the Interface and VRF providers are implemented, so it can be tested end-to-end without manual scaffolding |
Signed-off-by: Vasyl Paliuha <vasyl.paliuha@sap.com>
Added DHCP relay support for the Nokia SR Linux provider (
internal/provider/nokia/srlinux).EnsureDHCPRelayandDeleteDHCPRelayon the SR LinuxProvider, reaching feature parity with the existing Cisco NX-OS implementation.srl_nokia-interfaces/srl_nokia-interfaces-ip-dhcp-relay), targeting the per-subinterface gNMI path:srl_nokia-interfaces:interface[name=<iface>]/subinterface[index=<n>]/ipv4/srl_nokia-interfaces-ip-dhcp-relay:dhcp-relay.N) - e.g.ethernet-1/1.100→ interfaceethernet-1/1, subinterface index100.admin-state: enableexplicitly on every reconcile because it is the platform default; omitting it would produce a false diff on every subsequent GET.vrfRef: when set, the resolved VRF'sspec.nameis written tonetwork-instance; when unset the field is omitted from the payload (platform default is "no network-instance").interfaceRefspath the same way as the Cisco provider: returnsnilwithout touching the device.Testing
Tested manually against an emulated Nokia SR Linux device (
ghcr.io/nokia/srlinux:26.7.1)SR Linux has no InterfaceProvider yet, so the subinterface was pre-configured directly on the device and the Interface CR status was faked:
1. Apply the DHCPRelay CR and verify the device receives the configuration:
Device state after the controller reconciles (
gnmic geton the dhcp-relay path):{ "admin-state": "enable", "server": ["192.0.2.1"] }2. Idempotency - controller log after a second reconcile with no spec change:
No gNMI Set was issued.
3. Cross-VRF relay via
vrfRef:SR Linux has no VRF provider, so the VRF controller continuously overwrites the CR status to
NotImplemented- making it impossible to hold the VRF in aReadystate long enough for the DHCPRelay controller to complete a reconcile. The device-level behavior was verified directly with gnmic instead:The device correctly accepts
network-instancewhen it is included in the payload - confirmed by a direct gNMI Set and subsequent Get:{ "admin-state": "enable", "network-instance": "shared-services", "server": ["192.0.2.1"] }The provider code path for
vrfRefis covered by unit tests.4. Delete the CR and confirm the relay is removed from the device:
gnmic geton the same path returns an empty response - nodhcp-relaynode present.