Skip to content

Add peer interface annotation for physical interfaces#191

Merged
felix-kaestner merged 1 commit intomainfrom
annotation
Mar 4, 2026
Merged

Add peer interface annotation for physical interfaces#191
felix-kaestner merged 1 commit intomainfrom
annotation

Conversation

@felix-kaestner
Copy link
Contributor

@felix-kaestner felix-kaestner commented Feb 18, 2026

This patch introduces the PhysicalInterfaceNeighborLabel label which
references the peer Interface resource on the other end of a physical
link. The label can be used by users to declare expected cabling, or
by controllers to reflect actual cabling discovered via neighbor
discovery protocols (e.g., LLDP).

The label value must be the name of another Interface resource in the
same namespace. It is only valid for interfaces of type Physical.

Additionally, a PhysicalInterfaceNeighborRawAnnotation annotation is
introduced for interfaces connected to unmanaged devices (devices
without an Interface resource). The annotation value format is
"chassisID::portID" where chassisID is the LLDP chassis identifier
and portID is the LLDP port identifier.

Both the label and annotation are mutually exclusive - an interface
cannot have both set at the same time.

@felix-kaestner felix-kaestner requested a review from a team as a code owner February 18, 2026 21:54
@hardikdr hardikdr added the area/metal-automation Automation processes within the Metal project. label Feb 19, 2026
@hardikdr hardikdr added this to Roadmap Feb 19, 2026
@SchwarzM
Copy link

do we want to use an annotation in this case ? this makes it harder for cli tools to display / filter for it correctly I think

@felix-kaestner
Copy link
Contributor Author

do we want to use an annotation in this case ? this makes it harder for cli tools to display / filter for it correctly I think

@SchwarzM Changed to a label with a same-namespace constraint - the value is now just the interface name (no namespace prefix). This enables filtering while keeping the value label-compatible.

Copy link
Contributor

@nikatza nikatza left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the update!

This patch introduces the `PhysicalInterfaceNeighborLabel` label which
references the peer Interface resource on the other end of a physical
link. The label can be used by users to declare expected cabling, or
by controllers to reflect actual cabling discovered via neighbor
discovery protocols (e.g., LLDP).

The label value must be the name of another Interface resource in the
same namespace. It is only valid for interfaces of type Physical.

Additionally, a `PhysicalInterfaceNeighborRawAnnotation` annotation is
introduced for interfaces connected to unmanaged devices (devices
without an Interface resource). The annotation value format is
"chassisID::portID" where chassisID is the LLDP chassis identifier
and portID is the LLDP port identifier.

Both the label and annotation are mutually exclusive - an interface
cannot have both set at the same time.
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1 90.48% (+1.71%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1/groupversion_info.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/interface_webhook.go 93.62% (+10.28%) 47 (+23) 44 (+24) 3 (-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/webhook/core/v1alpha1/interface_webhook_test.go

@felix-kaestner felix-kaestner merged commit 52eae24 into main Mar 4, 2026
11 checks passed
@felix-kaestner felix-kaestner deleted the annotation branch March 4, 2026 09:49
@github-project-automation github-project-automation bot moved this to Done in Roadmap Mar 4, 2026
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.

4 participants