Skip to content

Commit

Permalink
Remove bridge from report
Browse files Browse the repository at this point in the history
Signed-off-by: Quique Llorente <[email protected]>
  • Loading branch information
qinqon committed Nov 27, 2019
1 parent bbe0919 commit 0fd70a7
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ func loadNetConf(bytes []byte) (*netConf, error) {
return netconf, nil
}

func setupBridge(brName string) *current.Interface {
return &current.Interface{
Name: brName,
Mac: getHardwareAddr(brName),
}
}

func generateRandomMac() net.HardwareAddr {
prefix := []byte{0x02, 0x00, 0x00} // local unicast prefix
suffix := make([]byte, 3)
Expand Down Expand Up @@ -244,8 +237,6 @@ func CmdAdd(args *skel.CmdArgs) error {
return err
}

brIface := setupBridge(bridgeName)

contNetns, err := ns.GetNS(args.Netns)
if err != nil {
return fmt.Errorf("failed to open netns %q: %v", args.Netns, err)
Expand All @@ -261,17 +252,8 @@ func CmdAdd(args *skel.CmdArgs) error {
return err
}

// Refetch the bridge since its MAC address may change when the first
// veth is added.
if err = refetchIface(brIface); err != nil {
return fmt.Errorf("failed to lookup %q: %v", brIface.Name, err)
}

// Refetch the bridge MAC since it may change when the first veth is added.
brIface.Mac = getHardwareAddr(brIface.Name)

result := &current.Result{
Interfaces: []*current.Interface{brIface, hostIface, contIface},
Interfaces: []*current.Interface{hostIface, contIface},
}

return types.PrintResult(result, netconf.CNIVersion)
Expand Down

0 comments on commit 0fd70a7

Please sign in to comment.