Add per-interface DHCP relay configuration - #543
Open
nikatza wants to merge 2 commits into
Open
Conversation
nikatza
force-pushed
the
origin/nxos-perinterface-dhcprelay
branch
3 times, most recently
from
September 2, 2026 20:21
7c9a1ec to
e84779b
Compare
nikatza
force-pushed
the
origin/nxos-perinterface-dhcprelay
branch
5 times, most recently
from
September 3, 2026 14:32
bc5a79e to
fe821a8
Compare
nikatza
force-pushed
the
origin/nxos-perinterface-dhcprelay
branch
2 times, most recently
from
September 3, 2026 14:40
7781873 to
2dab9bf
Compare
nikatza
marked this pull request as ready for review
September 3, 2026 14:51
nikatza
marked this pull request as draft
September 4, 2026 07:27
nikatza
force-pushed
the
origin/nxos-perinterface-dhcprelay
branch
5 times, most recently
from
September 5, 2026 10:44
d4fd217 to
c9f1305
Compare
Introduce per-interface configuration for the DHCPRelay relay (previously all interfaces were configured equally with one object). With this change the DHCPRelay is keyed with a Device and an Interface reference. This brings more flexibility to high-level resources. As per code project agreement the previous API is mantained and marked as deprecated: added validation hooks to return a warning if used. CEL rules prevent mixed used of deprecated and new format. The migration path for existing DHCPRelay objects that use the deprecated InterfaceRefs field requires deleting those objects and creating new ones using the new fields. Objects using the deprecated field InterfaceRefs likely replace the entire DHCPRelay tree and thus would remove configuration for all interfaces, even for those that are not referenced. Replace the interfaces list with a singular interfaceRef. DHCP server and VRF settings now live on the DHCPRelay resource, allowing each resource to configure a single interface. Update the controller and NX-OS provider to reconcile and delete relay configuration per interface, allowing multiple DHCPRelay resources on a device while rejecting duplicates for the same interface. Remove the status update, update samples/CRDs, and cover both the preferred and deprecated APIs in controller and gNMI tests. Signed-off-by: Pujol <enric.pujol@sap.com>
Track fixture resources in creation order and tear them down in reverse, waiting for each deletion to complete before continuing. This preserves dependency ordering and avoids concurrent cleanup races during envtest. An example for this situation is the DHCPRelay, which references Interfaces and VRFs. If these resources are deleted the finalizer fails as it can't derive the name of the interface/vrf on the device (e.g., eth1/1). On NXOS this would imply having to leave the entire dhcp tree on the post-delete section of the fixture. Signed-off-by: Pujol <enric.pujol@sap.com>
nikatza
force-pushed
the
origin/nxos-perinterface-dhcprelay
branch
from
September 5, 2026 10:53
c9f1305 to
93b0dd9
Compare
Merging this branch changes the coverage (2 decrease, 1 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
nikatza
marked this pull request as ready for review
September 5, 2026 11:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resources
K8s:
NXOS config:
NXOS
sh ip dhcp relay