diff --git a/pkg/daemon/ovs_linux.go b/pkg/daemon/ovs_linux.go index c300dfed022..c833b8670fd 100644 --- a/pkg/daemon/ovs_linux.go +++ b/pkg/daemon/ovs_linux.go @@ -1169,12 +1169,11 @@ func getShortSharedDir(uid types.UID, volumeName string) string { } func linkExists(name string) (bool, error) { - _, err := netlink.LinkByName(name) - if err == nil { - return true, nil - } else if _, ok := err.(netlink.LinkNotFoundError); ok { - return false, nil - } else { + if _, err := netlink.LinkByName(name); err != nil { + if _, ok := err.(netlink.LinkNotFoundError); ok { + return false, nil + } return false, err } + return true, nil }