Skip to content

Commit c68e15f

Browse files
committed
Upgrade mockgen version to 0.5.2
Added a check to ensure we are using the correct mockgen version. Used 'go get' to upgrade the mockgen version. Used 'go mod tidy' to clean up. Regenerated the mocks but got no changes.
1 parent 566faef commit c68e15f

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,17 @@ PROXY_SERVER_IP ?= 127.0.0.1
5757

5858
KIND_IMAGE ?= kindest/node:v1.30.2
5959
CONNECTION_MODE ?= grpc
60+
61+
MOCKGEN_VERSION := $(shell mockgen -version)
62+
DESIRED_MOCKGEN := "v0.5.2"
63+
6064
## --------------------------------------
6165
## Testing
6266
## --------------------------------------
6367
.PHONY: mock_gen
6468
mock_gen:
69+
echo "Mock gen is set to $(MOCKGEN_VERSION)"
70+
if [ "$(MOCKGEN_VERSION)" != $(DESIRED_MOCKGEN) ]; then echo "Error need mockgen version $(DESIRED_VERSION)"; exit 1; fi
6571
mkdir -p proto/agent/mocks
6672
mockgen --build_flags=--mod=mod sigs.k8s.io/apiserver-network-proxy/proto/agent AgentService_ConnectServer > proto/agent/mocks/agent_mock.go
6773
cat hack/go-license-header.txt proto/agent/mocks/agent_mock.go > proto/agent/mocks/agent_mock.licensed.go

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ Please ensure the go bin directory (usually `~/go/bin`) is in your `PATH`.
6161

6262
The [```mockgen```](https://github.com/uber-go/mock) tool must be installed on your system.
6363

64-
Currently, we are using go.uber.org/mock/[email protected].0
64+
Currently, we are using go.uber.org/mock/[email protected].2
6565

66-
`go install go.uber.org/mock/[email protected].0`
66+
`go install go.uber.org/mock/[email protected].2`
6767

6868
### Protoc
6969

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/spf13/pflag v1.0.6
1212
github.com/stretchr/testify v1.10.0
1313
go.uber.org/goleak v1.3.0
14-
go.uber.org/mock v0.5.0
14+
go.uber.org/mock v0.5.2
1515
golang.org/x/net v0.37.0
1616
google.golang.org/grpc v1.71.0
1717
google.golang.org/protobuf v1.36.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC
137137
go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
138138
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
139139
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
140-
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
141-
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
140+
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
141+
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
142142
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
143143
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
144144
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ go.opentelemetry.io/otel/trace/embedded
177177
## explicit; go 1.20
178178
go.uber.org/goleak
179179
go.uber.org/goleak/internal/stack
180-
# go.uber.org/mock v0.5.0
180+
# go.uber.org/mock v0.5.2
181181
## explicit; go 1.22
182182
go.uber.org/mock/gomock
183183
# golang.org/x/net v0.37.0

0 commit comments

Comments
 (0)