Skip to content

feat(interfaces): take the port index from the port layout - #81

Closed
djothi wants to merge 2 commits into
mainfrom
feat/port-layout-index
Closed

djothi wants to merge 2 commits into
mainfrom
feat/port-layout-index

Conversation

@djothi

@djothi djothi commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Description:

Take the front-panel port index from the new index field of the CMDB port layout instead of guessing it from the port short name.

Guessing broke on platforms whose short names don't match the NOS index (e.g. numbered from zero).

When the layout has no index, none is emitted. Breakout ports share the index of their parent port.

Before the commit:

Index derived from the short name:

  • etp1 → 0
  • etp3a → 2
  • etp0 → no index

After the commit:

Index taken as is from the CMDB port layout.

kpetremann and others added 2 commits October 23, 2026 23:11
Use the new `index` field of the CMDB port layout instead of guessing
it from the port short name. No index is emitted when the layout has
none.
@djothi
djothi requested a review from a team October 23, 2026 14:16
ethernet.Index = &index
} else {
log.Debug().Msgf("no port index derivable from %q for interface %s of %s", port.VendorShortName, deviceInterface.Name, hostname)
log.Debug().Msgf("no port index in the port layout of interface %s of %s", deviceInterface.Name, hostname)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it should be an error no?

FAR: maybe same for Lanes above.

@djothi djothi closed this Oct 23, 2026
@djothi
djothi deleted the feat/port-layout-index branch October 23, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants