From 656e4c1f56260b14511e87db0eae42bf4740d30d Mon Sep 17 00:00:00 2001 From: Pat Dumais Date: Sun, 20 Aug 2023 08:40:46 -0400 Subject: [PATCH 1/2] # This is a combination of 3 commits. # This is the 1st commit message: Listing bridges # This is the commit message #2: Listing bridges # This is the commit message #3: Listing bridges --- nodes/ovs/ovs.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nodes/ovs/ovs.go b/nodes/ovs/ovs.go index d76791897..b83f97345 100644 --- a/nodes/ovs/ovs.go +++ b/nodes/ovs/ovs.go @@ -12,6 +12,7 @@ import ( goOvs "github.com/digitalocean/go-openvswitch/ovs" log "github.com/sirupsen/logrus" cExec "github.com/srl-labs/containerlab/clab/exec" + "github.com/srl-labs/containerlab/internal/slices" "github.com/srl-labs/containerlab/links" "github.com/srl-labs/containerlab/nodes" "github.com/srl-labs/containerlab/nodes/state" @@ -54,7 +55,14 @@ func (n *ovs) CheckDeploymentConditions(_ context.Context) error { goOvs.Sudo(), ) - if _, err := c.VSwitch.Get.Bridge(n.Cfg.ShortName); err != nil { + // We were previously doing c.VSwitch.Get.Bridge() but it doesn't work + // when the bridge has a propotocol version higher than 1.0 + // So listing the bridges is safer + bridges, err := c.VSwitch.ListBridges() + if err != nil { + return fmt.Errorf("error while looking for ovs bridge %q: %v", n.Cfg.ShortName, err) + } + if !slices.Contains(bridges, n.Cfg.ShortName) { return fmt.Errorf("could not find ovs bridge %q", n.Cfg.ShortName) } From 90776dff0fa2b42352b6661de87d8287a4c7c7ed Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Tue, 22 Aug 2023 13:50:01 +0300 Subject: [PATCH 2/2] listing ovs bridges Co-authored-by: pdumais --- docs/rn/0.44.md | 1 + nodes/ovs/ovs.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/rn/0.44.md b/docs/rn/0.44.md index 8f0330b8c..7983e35fd 100644 --- a/docs/rn/0.44.md +++ b/docs/rn/0.44.md @@ -49,3 +49,4 @@ Read more about this feature in the [Certificates Management](../manual/cert.md# * fixing CLAB_INTFS env var #1547 * fixing node filtering functionality #1549 +* fixing ovs bridges and openflow 1.3 #1539 diff --git a/nodes/ovs/ovs.go b/nodes/ovs/ovs.go index b83f97345..1f6efd45c 100644 --- a/nodes/ovs/ovs.go +++ b/nodes/ovs/ovs.go @@ -56,11 +56,11 @@ func (n *ovs) CheckDeploymentConditions(_ context.Context) error { ) // We were previously doing c.VSwitch.Get.Bridge() but it doesn't work - // when the bridge has a propotocol version higher than 1.0 + // when the bridge has a protocol version higher than 1.0 // So listing the bridges is safer bridges, err := c.VSwitch.ListBridges() if err != nil { - return fmt.Errorf("error while looking for ovs bridge %q: %v", n.Cfg.ShortName, err) + return fmt.Errorf("error while listing ovs bridges: %v", err) } if !slices.Contains(bridges, n.Cfg.ShortName) { return fmt.Errorf("could not find ovs bridge %q", n.Cfg.ShortName)