Skip to content

Support LLDP configuration#209

Merged
nikatza merged 4 commits intomainfrom
lldp
Mar 6, 2026
Merged

Support LLDP configuration#209
nikatza merged 4 commits intomainfrom
lldp

Conversation

@nikatza
Copy link
Contributor

@nikatza nikatza commented Mar 5, 2026

No description provided.

@nikatza nikatza force-pushed the lldp branch 5 times, most recently from d402159 to 119f0d3 Compare March 5, 2026 17:12
@nikatza nikatza marked this pull request as ready for review March 5, 2026 17:12
@nikatza nikatza requested a review from a team as a code owner March 5, 2026 17:12
@hardikdr hardikdr added the area/metal-automation Automation processes within the Metal project. label Mar 6, 2026
@hardikdr hardikdr added this to Roadmap Mar 6, 2026
@nikatza nikatza force-pushed the lldp branch 2 times, most recently from 371767c to 4b23b36 Compare March 6, 2026 10:52
nikatza added 4 commits March 6, 2026 12:01
Add core types to configure Link-Layer Discovery Protocol on devices.
The type includes a system-wide setting to enable and disable LLDP.
Following OpenConfig design, this type allows per-interface
configuration (enable/disable).

Notice that the interaction of global and per-interface settings may
differ on each platform and provider implementation. Also, some
platforms like NXOS allow configuring more settings than those defined
in OpenConfig, e.g., disable or enable receive and transmit. This is
currently not required by our use case. If this is ever needed this API
will need to change.
The controller validates that the referenced Device exists and is not
paused, that ProviderConfigRef (if specified) points to a supported
provider-specific configuration, and that all InterfaceRefs belong to
the same device. It also ensures only one LLDP resource exists per
device.

During reconciliation, the controller sets the device label and owner
reference on the LLDP resource, then calls the provider to apply the
LLDP configuration and retrieve operational status. The controller
watches for Device Paused field changes and ProviderConfig updates to
trigger re-reconciliation when dependencies change. Periodic polling
via RequeueInterval ensures operational status stays updated.
Add LLDPConfig CRD for Cisco NX-OS specific LLDP settings that extend
the core LLDP configuration. This resource can be referenced via the
ProviderConfigRef field in the LLDP spec.

The LLDPConfig allows setting InitDelay, the number of seconds to wait
before LLDP starts sending packets after an interface comes up, and
HoldTime, the duration in seconds that receiving devices should retain
LLDP information before discarding it.
Enable or disable the LLDP feature based on the AdminState in the spec.
When enabled, configure per-interface Tx/Rx settings based on the
InterfaceRefs. The core API does not distinguish between Tx and Rx, so
both are set to the same value.

If a LLDPConfig is referenced via ProviderConfigRef, apply the InitDelay
and HoldTime settings.

On deletion, disable the LLDP feature on the device.
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Merging this branch changes the coverage (1 decrease, 2 increase)

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/api/core/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/cmd 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/controller/core 62.65% (+0.43%) 👍
github.com/ironcore-dev/network-operator/internal/provider 52.00% (+4.00%) 👍
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos 10.70% (-0.18%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1/lldpconfig_types.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/api/cisco/nx/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/api/core/v1alpha1/groupversion_info.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/api/core/v1alpha1/lldp_types.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/api/core/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/cmd/main.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/internal/controller/core/lldp_controller.go 68.14% (+68.14%) 204 (+204) 139 (+139) 65 (+65) 🌟
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/lldp.go 66.67% (+66.67%) 3 (+3) 2 (+2) 1 (+1) 🌟
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/provider.go 0.07% (-0.00%) 1537 (+51) 1 1536 (+51) 👎
github.com/ironcore-dev/network-operator/internal/provider/provider.go 52.00% (+4.00%) 25 13 (+1) 12 (-1) 👍

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

  • github.com/ironcore-dev/network-operator/internal/controller/core/lldp_controller_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/lldp_test.go

@nikatza nikatza requested a review from felix-kaestner March 6, 2026 11:21
Copy link
Contributor

@felix-kaestner felix-kaestner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@nikatza nikatza merged commit 0a8a6db into main Mar 6, 2026
11 checks passed
@github-project-automation github-project-automation bot moved this to Done in Roadmap Mar 6, 2026
@nikatza nikatza deleted the lldp branch March 6, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/metal-automation Automation processes within the Metal project.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants