Skip to content

Refactor CreatePort - #789

Merged
sonikajindal merged 4 commits into
openconfig:mainfrom
gavinz-ship-it:main
Nov 7, 2026
Merged

sonikajindal merged 4 commits into
openconfig:mainfrom
gavinz-ship-it:main

Conversation

@gavinz-ship-it

Copy link
Copy Markdown
Contributor

I find the code of CreatePort very hard to read so I refactored it a little bit. Specifically I created some helper functions storeAttributes, storeSwitchAttribute, getSgs, getQueues.

After the change, the main logic of CreatePort is shorter and easier to read.

@gavinz-ship-it
gavinz-ship-it requested a review from a team as a code owner November 6, 2026 19:28
@hardikharti

Copy link
Copy Markdown
Contributor

/gcbrun

Comment thread dataplane/saiserver/ports.go Resolved
Comment thread dataplane/saiserver/ports.go Resolved
Comment thread dataplane/saiserver/ports.go Resolved
@sonikajindal

Copy link
Copy Markdown
Contributor

Overall the refactor looks good, jetski pointed out a few readability and nits I posted

Update names
Do not perform port update statement for dummy ports.
@sonikajindal

Copy link
Copy Markdown
Contributor

/gcbrun

@sonikajindal
sonikajindal merged commit 1035c03 into openconfig:main Nov 7, 2026
15 checks passed
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.

3 participants