diff mbox series

[ovs-dev] Copy external_ids from Logical_Router_Port to SB database

Message ID 20220127080929.181056-1-selvaraj.p@nutanix.com
State Superseded
Headers show
Series [ovs-dev] Copy external_ids from Logical_Router_Port to SB database | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Selvaraj Palaniyappan Jan. 27, 2022, 8:09 a.m. UTC
This patch makes ovn-northd copy all string-string pairs in
external_ids column of the Logical_Router_Port table in Northbound
database to the equivalent column of the Port_Binding table in
Southbound database.
---
 northd/northd.c     |  1 +
 ovn-nb.xml          |  6 ++++++
 ovn-sb.xml          |  3 ++-
 tests/ovn-northd.at | 14 ++++++++++++++
 4 files changed, 23 insertions(+), 1 deletion(-)

Comments

0-day Robot Jan. 27, 2022, 9:20 a.m. UTC | #1
References:  <20220127080929.181056-1-selvaraj.p@nutanix.com>
 

Bleep bloop.  Greetings Selvaraj Palaniyappan, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Selvaraj Palaniyappan <selvaraj.p@nutanix.com> needs to sign off.
Lines checked: 88, Warnings: 0, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/northd/northd.c b/northd/northd.c
index fc7a64f99..090922ae2 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -3240,6 +3240,7 @@  ovn_port_update_sbrec(struct northd_input *input_data,
         ds_destroy(&s);
 
         struct smap ids = SMAP_INITIALIZER(&ids);
+        smap_clone(&ids, &op->nbrp->external_ids);
         sbrec_port_binding_set_external_ids(op->sb, &ids);
 
         sbrec_port_binding_set_nat_addresses(op->sb, NULL, 0);
diff --git a/ovn-nb.xml b/ovn-nb.xml
index 6a6972856..293d25b32 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -2895,6 +2895,12 @@ 
     <group title="Common Columns">
       <column name="external_ids">
         See <em>External IDs</em> at the beginning of this document.
+        <p>
+          The <code>ovn-northd</code> program copies all these pairs into the
+          <ref column="external_ids"/> column of the
+          <ref table="Port_Binding"/> table in <ref db="OVN_Southbound"/>
+          database.
+        </p>
       </column>
     </group>
   </table>
diff --git a/ovn-sb.xml b/ovn-sb.xml
index 9ddacdf09..f7c41ccdc 100644
--- a/ovn-sb.xml
+++ b/ovn-sb.xml
@@ -3354,7 +3354,8 @@  tcp.flags = RST;
         <p>
           The <code>ovn-northd</code> program populates this column with
           all entries into the <ref column="external_ids"/> column of the
-          <ref table="Logical_Switch_Port"/> table of the
+          <ref table="Logical_Switch_Port"/> and
+          <ref table="Logical_Router_Port"/> tables of the
           <ref db="OVN_Northbound"/> database.
         </p>
       </column>
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 84e52e701..f9c5259f1 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -144,6 +144,20 @@  AT_CHECK([test x`ovn-nbctl lsp-get-up S1-R1` = xup])
 AT_CLEANUP
 ])
 
+OVN_FOR_EACH_NORTHD([
+AT_SETUP([check external id propagation to SBDB])
+ovn_start
+
+ovn-nbctl lr-add ro
+ovn-nbctl lrp-add ro lrp0 00:00:00:00:00:01 192.168.1.1/24
+ovn-nbctl --wait=sb set logical_router_port lrp0 external_ids=test=123
+AT_CHECK([ovn-sbctl --columns=external_ids --bare find Port_Binding logical_port=lrp0],
+[0], [test=123
+])
+
+AT_CLEANUP
+])
+
 OVN_FOR_EACH_NORTHD([
 AT_SETUP([check IPv6 RA config propagation to SBDB])
 ovn_start