Skip to content

Commit

Permalink
Delete ovs bridge when forwarder stop
Browse files Browse the repository at this point in the history
Related issue: #276

Signed-off-by: Laszlo Kiraly <[email protected]>
  • Loading branch information
ljkiraly committed Nov 10, 2023
1 parent dc8f123 commit 8e060af
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/tools/utils/ovs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2022 Nordix Foundation.
// Copyright (c) 2021-2023 Nordix Foundation.
//
// Copyright (c) 2023 Cisco and/or its affiliates.
//
Expand Down Expand Up @@ -108,6 +108,14 @@ func ConfigureOvS(ctx context.Context, l2Connections map[string]*L2ConnectionPoi
return nil
}

// DeleteBridge delete ovs bridge for client and endpoint connections
func DeleteBridge(ctx context.Context, bridgeName string) {
stdout, stderr, err := util.RunOVSVsctl("del-br", bridgeName)
if err != nil {
log.FromContext(ctx).Warnf("Failed to remove bridge %s, stdout: %q, stderr: %q, error: %v", bridgeName, stdout, stderr, err)
}
}

func configureL2Interface(ctx context.Context, cp *L2ConnectionPoint) error {
link, err := netlink.LinkByName(cp.Interface)
if err != nil {
Expand Down

0 comments on commit 8e060af

Please sign in to comment.