Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple address entries per port in Logical_Switch_Port #1

Merged
merged 1 commit into from
Aug 30, 2021
Merged

Support multiple address entries per port in Logical_Switch_Port #1

merged 1 commit into from
Aug 30, 2021

Conversation

rnurgaliyev
Copy link
Contributor

According to the OVN northbound reference, one logical port may have more than one address in Logical_Switch_Port table.

https://man7.org/linux/man-pages/man5/ovn-nb.5.html#Logical_Switch_Port_TABLE

This pull request makes it possible to parse all address entries, including IPv4, IPv6, and keyword entries, such as "unknown" or "router".

Before this change, this library would crash if it encounters a multiple address entry for a port in Northbound OVSDB:

Aug 19 12:05:47 xx prometheus-ovn-exporter[61679]: panic: interface conversion: interface {} is uint8, not string
Aug 19 12:05:47 xx prometheus-ovn-exporter[61679]: goroutine 36 [running]:
Aug 19 12:05:47 xx prometheus-ovn-exporter[61679]: github.com/greenpau/ovsdb.(*Row).GetColumnValue(0xc00026ab00, 0x9ceb0f, 0x9, 0xc0002ae930, 0x937480, 0xc00072ecc0, 0xc0001ee5b8, 0x11, 0x0, 0x0)
Aug 19 12:05:47 xx prometheus-ovn-exporter[61679]:         /go/pkg/mod/github.com/greenpau/ovsdb@v0.0.0-20181114004433-3582b85e8968/result.go:56 +0x21e5
Aug 19 12:05:47 xx prometheus-ovn-exporter[61679]: github.com/greenpau/ovsdb.(*OvnClient).GetLogicalSwitchPorts(0xc00030a000, 0x31, 0xc00026b780, 0x1, 0x1, 0x2)
Aug 19 12:05:47 xx prometheus-ovn-exporter[61679]:         /go/pkg/mod/github.com/greenpau/ovsdb@v0.0.0-20181114004433-3582b85e8968/ovn_logical_switch_port.go:85 +0x45d

@greenpau
Copy link
Owner

@rnurgaliyev , thank you for the PR! I will review it next week!

@greenpau
Copy link
Owner

@rnurgaliyev , how did you test it?

@greenpau greenpau merged commit 1373261 into greenpau:main Aug 30, 2021
@greenpau
Copy link
Owner

@rnurgaliyev , LGTM! 👍

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.

None yet

2 participants