diff mbox series

[ovs-dev] doc, ovn-nbctl: Make it clear that LB can be without protocol

Message ID 20220912091410.2124408-1-amusil@redhat.com
State Accepted
Headers show
Series [ovs-dev] doc, ovn-nbctl: Make it clear that LB can be without protocol | expand

Checks

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

Commit Message

Ales Musil Sept. 12, 2022, 9:14 a.m. UTC
The load balancers can operate without specified protocol.
Update the documentation for ovn-northd lflows with what is
actually created by northd and change the output of
ovn-nbctl lb-list to include protocol only if the
port is specified. Without port it is just L3 load balalncer.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 northd/ovn-northd.8.xml |  2 +-
 tests/ovn-nbctl.at      | 40 ++++++++++++++++++++--------------------
 utilities/ovn-nbctl.c   |  2 +-
 3 files changed, 22 insertions(+), 22 deletions(-)

Comments

Dumitru Ceara Sept. 22, 2022, 2:37 p.m. UTC | #1
On 9/12/22 11:14, Ales Musil wrote:
> The load balancers can operate without specified protocol.
> Update the documentation for ovn-northd lflows with what is
> actually created by northd and change the output of
> ovn-nbctl lb-list to include protocol only if the
> port is specified. Without port it is just L3 load balalncer.
> 
> Signed-off-by: Ales Musil <amusil@redhat.com>
> ---

There was a tiny conflict.  I fixed that and applied the patch to the
main branch, thanks!
diff mbox series

Patch

diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml
index f4eceb0ec..8f724b4d1 100644
--- a/northd/ovn-northd.8.xml
+++ b/northd/ovn-northd.8.xml
@@ -862,7 +862,7 @@ 
         <var>PORT</var> of protocol <var>P</var> and IP address
         <var>VIP</var>, a priority-120 flow is added.  For IPv4 <var>VIPs
         </var>, the flow matches <code>ct.new &amp;&amp; ip &amp;&amp;
-        ip4.dst == <var>VIP</var> &amp;&amp; <var>P</var> &amp;&amp;
+        ip4.dst == <var>VIP</var> &amp;&amp;
         <var>P</var>.dst == <var>PORT</var></code>.  For IPv6 <var>VIPs</var>,
         the flow matches <code>ct.new &amp;&amp; ip &amp;&amp; ip6.dst == <var>
         VIP </var>&amp;&amp; <var>P</var> &amp;&amp; <var>P</var>.dst == <var>
diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at
index 726efa6f4..6a5d52a5d 100644
--- a/tests/ovn-nbctl.at
+++ b/tests/ovn-nbctl.at
@@ -934,8 +934,8 @@  AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP             IPs
 <0>    lb0                 tcp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
 <1>    lb1                 udp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:8080
-<2>    lb2                 tcp        30.0.0.30       192.168.10.10
-<3>    lb3                 tcp        30.0.0.30       192.168.10.10
+<2>    lb2                            30.0.0.30       192.168.10.10
+<3>    lb3                            30.0.0.30       192.168.10.10
 ])
 AT_CHECK([ovn-nbctl lb-del lb2 30.0.0.30])
 AT_CHECK([ovn-nbctl lb-del lb3 30.0.0.30])
@@ -987,14 +987,14 @@  AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP             IPs
 <0>    lb0                 tcp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
 <1>    lb1                 udp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
-<2>    lb3                 tcp        30.0.0.10       192.168.10.10,192.168.10.20
+<2>    lb3                            30.0.0.10       192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0])
 AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP             IPs
 <0>    lb1                 udp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
-<1>    lb3                 tcp        30.0.0.10       192.168.10.10,192.168.10.20
+<1>    lb3                            30.0.0.10       192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1])
@@ -1019,9 +1019,9 @@  AT_CHECK([ovn-nbctl add logical_switch ls0 load_balancer_group $lbg])
 
 AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP          IPs
-<0>    lb4                 tcp        40.0.0.10    162.168.10.10,162.168.10.20
-<1>    lb5                 tcp        50.0.0.10    172.168.10.10,172.168.10.20
-<2>    lb6                 tcp        60.0.0.10    182.168.10.10,182.168.10.20
+<0>    lb4                            40.0.0.10    162.168.10.10,162.168.10.20
+<1>    lb5                            50.0.0.10    172.168.10.10,172.168.10.20
+<2>    lb6                            60.0.0.10    182.168.10.10,182.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl remove logical_switch ls0 load_balancer_group $lbg])
@@ -1047,14 +1047,14 @@  AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP             IPs
 <0>    lb0                 tcp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
 <1>    lb1                 udp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
-<2>    lb3                 tcp        30.0.0.10       192.168.10.10,192.168.10.20
+<2>    lb3                            30.0.0.10       192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0])
 AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP             IPs
 <0>    lb1                 udp        30.0.0.10:80    192.168.10.10:80,192.168.10.20:80
-<1>    lb3                 tcp        30.0.0.10       192.168.10.10,192.168.10.20
+<1>    lb3                            30.0.0.10       192.168.10.10,192.168.10.20
 ])
 
 AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1])
@@ -1081,9 +1081,9 @@  AT_CHECK([ovn-nbctl add logical_router lr0 load_balancer_group $lbg])
 
 AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP          IPs
-<0>    lb4                 tcp        40.0.0.10    162.168.10.10,162.168.10.20
-<1>    lb5                 tcp        50.0.0.10    172.168.10.10,172.168.10.20
-<2>    lb6                 tcp        60.0.0.10    182.168.10.10,182.168.10.20
+<0>    lb4                            40.0.0.10    162.168.10.10,162.168.10.20
+<1>    lb5                            50.0.0.10    172.168.10.10,172.168.10.20
+<2>    lb6                            60.0.0.10    182.168.10.10,182.168.10.20
 ])])
 
 dnl ---------------------------------------------------------------------
@@ -1234,8 +1234,8 @@  AT_CHECK([ovn-nbctl lb-list | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb0                 tcp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
 <1>    lb1                 udp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:8080
-<2>    lb2                 tcp        ae0f::30         fd0f::10
-<3>    lb3                 tcp        ae0f::30         fd0f::10
+<2>    lb2                            ae0f::30         fd0f::10
+<3>    lb3                            ae0f::30         fd0f::10
 ])
 AT_CHECK([ovn-nbctl lb-del lb2 ae0f::30])
 AT_CHECK([ovn-nbctl lb-del lb3 ae0f::30])
@@ -1287,14 +1287,14 @@  AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb0                 tcp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
 <1>    lb1                 udp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
-<2>    lb3                 tcp        ae0f::10         fd0f::10,fd0f::20
+<2>    lb3                            ae0f::10         fd0f::10,fd0f::20
 ])
 
 AT_CHECK([ovn-nbctl ls-lb-del ls0 lb0])
 AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb1                 udp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
-<1>    lb3                 tcp        ae0f::10         fd0f::10,fd0f::20
+<1>    lb3                            ae0f::10         fd0f::10,fd0f::20
 ])
 
 AT_CHECK([ovn-nbctl ls-lb-del ls0 lb1])
@@ -1328,7 +1328,7 @@  AT_CHECK([ovn-nbctl ls-lb-list ls0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb4                 tcp        [[ae07::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
 <1>    lb5                 udp        [[ae08::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
-<2>    lb6                 tcp        ae09::10         fd0f::10,fd0f::20
+<2>    lb6                            ae09::10         fd0f::10,fd0f::20
 ])
 
 AT_CHECK([ovn-nbctl remove logical_switch ls0 load_balancer_group $lbg])
@@ -1347,14 +1347,14 @@  AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb0                 tcp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
 <1>    lb1                 udp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
-<2>    lb3                 tcp        ae0f::10         fd0f::10,fd0f::20
+<2>    lb3                            ae0f::10         fd0f::10,fd0f::20
 ])
 
 AT_CHECK([ovn-nbctl lr-lb-del lr0 lb0])
 AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb1                 udp        [[ae0f::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
-<1>    lb3                 tcp        ae0f::10         fd0f::10,fd0f::20
+<1>    lb3                            ae0f::10         fd0f::10,fd0f::20
 ])
 
 AT_CHECK([ovn-nbctl lr-lb-del lr0 lb1])
@@ -1375,7 +1375,7 @@  AT_CHECK([ovn-nbctl lr-lb-list lr0 | uuidfilt], [0], [dnl
 UUID                                    LB                  PROTO      VIP              IPs
 <0>    lb4                 tcp        [[ae07::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
 <1>    lb5                 udp        [[ae08::10]]:80    [[fd0f::10]]:80,[[fd0f::20]]:80
-<2>    lb6                 tcp        ae09::10         fd0f::10,fd0f::20
+<2>    lb6                            ae09::10         fd0f::10,fd0f::20
 ])])
 
 dnl ---------------------------------------------------------------------
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index 3bbdbd998..2016ec9d4 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -3044,7 +3044,7 @@  lb_info_add_smap(const struct nbrec_load_balancer *lb,
                 continue;
             }
 
-            char *protocol = ss_get_port(&ss) ? lb->protocol : "tcp";
+            char *protocol = ss_get_port(&ss) ? lb->protocol : "";
             i == 0 ? ds_put_format(&val,
                         UUID_FMT "    %-20.16s%-11.7s%-*.*s%s",
                         UUID_ARGS(&lb->header_.uuid),