eBay / go-ovn

A Go library for OVN Northbound/Southbound DB access using native OVSDB protocol
Apache License 2.0
108 stars 59 forks source link

Add api support for NB/SB Global tables and fix the LSP APIs for options and external ids. #84

Closed abhat closed 4 years ago

abhat commented 4 years ago

This commit adds support for creating and deleting NB/SB rows via the go-api as also the ability to set options on the rows. In reality the add/delete rows is only used for unit-testing since ovn-northd is the one that creates the rows during start up in the NB_Global table.

There was also a bug in the way the LSP SetOptions and SetExternalIds api worked. Updating entries in these maps would fail since instead of calling an opUpdate on the entire row, these APIs were trying to mutate options/external-ids using individual key-values using opInsert. That would have failed unless there is a delete first followed by an insert.

noah8713 commented 4 years ago

Many UTs are failing on this current patch: https://travis-ci.org/github/eBay/go-ovn/jobs/677990243 . Can you please fix them and amend the patch with correction?

abhat commented 4 years ago

P.S. the test failure may be due to the fact that OVN DBs are initiated with the row in Global table, so you can't add one if it existed. Maybe the API of adding the row in Global table is not quite useful.

Yes, I didn't realize that the OVN DBs are initiate with rows in Global table. That violates the schema constraint of having only one row. Do you know who is adding that row in the Global table? I know a row is added by northd if it doesn't exist.