Skip to content

Commit

Permalink
fix e2e testing on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed May 17, 2021
1 parent c13e5e1 commit a0006eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ require (
github.com/stretchr/testify v1.6.1
github.com/vishvananda/netlink v1.1.0
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f // indirect
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd
google.golang.org/grpc v1.27.1
k8s.io/api v0.20.4
k8s.io/apimachinery v0.20.4
Expand Down
8 changes: 4 additions & 4 deletions pkg/util/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"strings"

"github.com/vishvananda/netlink"
"golang.org/x/sys/unix"
"k8s.io/klog"

kubeovnv1 "github.com/kubeovn/kube-ovn/pkg/apis/kubeovn/v1"
Expand Down Expand Up @@ -164,11 +164,11 @@ func CheckProtocol(address string) string {
func ProtocolToFamily(protocol string) (int, error) {
switch protocol {
case kubeovnv1.ProtocolDual:
return netlink.FAMILY_ALL, nil
return unix.AF_UNSPEC, nil
case kubeovnv1.ProtocolIPv4:
return netlink.FAMILY_V4, nil
return unix.AF_INET, nil
case kubeovnv1.ProtocolIPv6:
return netlink.FAMILY_V6, nil
return unix.AF_INET6, nil
default:
return -1, fmt.Errorf("invalid protocol: %s", protocol)
}
Expand Down

0 comments on commit a0006eb

Please sign in to comment.