Open
Conversation
02eab6f to
f30d465
Compare
f30d465 to
579d696
Compare
Add core types to configure DHCP relay on L3 interfaces. The DHCPRelay resource is device-scoped (one per device) and references a list of Layer 3 interfaces where DHCP relay should be enabled, along with the DHCP server addresses. Supported interface types are Physical, Aggregate, and RoutedVLAN (Layer 3 SVIs). The controller will validate that all referenced interfaces belong to the same device and are configured with IPv4 addressing. The optional VrfRef field allows specifying which VRF context should be used when forwarding DHCP messages to the servers.
8187976 to
07e796b
Compare
| // InterfaceRefs is a list of interfaces | ||
| // +optional | ||
| // +listType=atomic | ||
| InterfaceRefs []LocalObjectReference `json:"interfaceRefs,omitempty"` |
Contributor
There was a problem hiding this comment.
Suggested change
| InterfaceRefs []LocalObjectReference `json:"interfaceRefs,omitempty"` | |
| // +kubebuilder:validation:MinItems=1 | |
| InterfaceRefs []LocalObjectReference `json:"interfaceRefs,omitempty"` |
should we require at least 1?
Contributor
Author
There was a problem hiding this comment.
I wanted to leave the user the option to have the resource disabled with no referenced interfaces. But no strong opinion, i will add this.
Contributor
There was a problem hiding this comment.
Fair point. I think we have the same situation in other resources, such as the NTP.
The controller validates that the referenced Device exists and is not paused, that all InterfaceRefs belong to the same device and are Layer 3 interfaces (Physical, Aggregate, or RoutedVLAN types) with IPv4 configuration, and that the optional VrfRef belongs to the same device. It enforces that only one DHCPRelay resource exists per device. The controller retrieves the list of interfaces that have DHCP relay configured on the device and updates the ConfiguredInterfaceRefs status field. The controller watches for Device Paused field changes, Interface Ready condition changes, VRF Ready condition changes, and ProviderConfig updates to trigger re-reconciliation when dependencies change. The controller considers only the Configuration condition of the referenced resources as DHCPRelay is a configuration resource only.
Enable or disable the DHCP feature based on AdminState. When enabled, configure DHCP relay on each referenced interface with the specified server addresses. The provider uses the VRF context from VrfRef (or the NXOS default "!unspecified" if no VRF is specified) when configuring server addresses. The implementation uses the Update operation to ensure stale DHCP relay entries are removed when the configuration changes. This also affects entries referencing interfaces not managed by the operator. The entire tree is removed on deletion, affecting non-managed interfaces., It leaves the DHCP feature in its current state. GetDHCPRelayStatus queries the device for all interfaces with DHCP relay configured and returns their names.
SA1019: LoadCertificate is deprecated but we still it on NXOS
07e796b to
eb1d240
Compare
Merging this branch will decrease overall coverage
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
|
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.
No description provided.