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

List OVS bridges to allow for OF version >1.0 #1539

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/rn/0.44.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 9 additions & 1 deletion nodes/ovs/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 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 listing ovs bridges: %v", err)
}
if !slices.Contains(bridges, n.Cfg.ShortName) {
return fmt.Errorf("could not find ovs bridge %q", n.Cfg.ShortName)
}

Expand Down