Skip to content

Commit

Permalink
replace github.com/golang/mock with go.uber.org/mock/mockgen (#3664)
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian authored Jan 25, 2024
1 parent 82986a6 commit c11ce4d
Show file tree
Hide file tree
Showing 11 changed files with 364 additions and 356 deletions.
2 changes: 1 addition & 1 deletion dist/images/ovn-ic-db-docker.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker run -d --network=host -v /etc/ovn/:/etc/ovn -v /var/run/ovn:/var/run/ovn -v /var/log/ovn:/var/log/ovn kubeovn/kube-ovn:v1.10.0 bash start-ic-db.sh
docker run -d --network=host -v /etc/ovn/:/etc/ovn -v /var/run/ovn:/var/run/ovn -v /var/log/ovn:/var/log/ovn kubeovn/kube-ovn:v1.13.0 bash start-ic-db.sh
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/emicklei/go-restful/v3 v3.11.2
github.com/evanphx/json-patch/v5 v5.8.1
github.com/go-logr/stdr v1.2.2
github.com/golang/mock v1.6.0
github.com/greenpau/ovsdb v1.0.3
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/k8snetworkplumbingwg/sriovnet v1.2.0
Expand All @@ -35,6 +34,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/vishvananda/netlink v1.2.1-beta.2
go.uber.org/mock v0.4.0
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
golang.org/x/mod v0.14.0
golang.org/x/sys v0.16.0
Expand Down Expand Up @@ -125,6 +125,7 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/cadvisor v0.47.3 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2138,6 +2138,8 @@ go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
Expand Down
2 changes: 1 addition & 1 deletion hack/mockgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -o errexit
set -o nounset
set -o pipefail

# require mockgen v1.6.0+
# require go.uber.org/mock/mockgen
go generate ./mocks
699 changes: 352 additions & 347 deletions mocks/pkg/ovs/interface.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package controller
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"k8s.io/client-go/informers"
coreinformers "k8s.io/client-go/informers/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/ovn_ic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package controller
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/scylladb/go-set/strset"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/kubeovn/kube-ovn/pkg/ovsdb/ovnnb"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/security_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package controller
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/kubeovn/kube-ovn/pkg/ovs"
"github.com/kubeovn/kube-ovn/pkg/ovsdb/ovnnb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down
2 changes: 1 addition & 1 deletion yamls/ovn-dpdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ spec:
hostNetwork: true
containers:
- name: ovn-central
image: "kubeovn/kube-ovn:v1.12.0"
image: "kubeovn/kube-ovn:v1.13.0"
imagePullPolicy: IfNotPresent
command:
- /kube-ovn/start-db.sh
Expand Down
2 changes: 1 addition & 1 deletion yamls/rh-mod-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- job
containers:
- name: centos7-module
image: kubeovn/centos7-compile:v1.10.0
image: kubeovn/centos7-compile:v1.13.0
imagePullPolicy: IfNotPresent
command:
- /fastpath/entrypoint.sh
Expand Down

0 comments on commit c11ce4d

Please sign in to comment.