antrea-io / antrea

Kubernetes networking based on Open vSwitch
https://antrea.io
Apache License 2.0
1.65k stars 362 forks source link

go mod tidy is broken with go 1.13 #81

Closed tnqn closed 4 years ago

tnqn commented 4 years ago

Describe the bug Failed to execute go mod tidy with go 1.13.4

go: finding github.com/vmware/octant v0.9.1
github.com/vmware-tanzu/antrea/cmd/antrea-octant-plugin imports
        github.com/vmware/octant/pkg/navigation tested by
        github.com/vmware/octant/pkg/navigation.test imports
        github.com/vmware/octant/pkg/store/fake: module github.com/vmware/octant@latest found (v0.9.1, replaced by github.com/vmware-tanzu/octant@v0.8.0), but does not contain package github.com/vmware/
octant/pkg/store/fake

To Reproduce Execute go mod tidy

Expected It should tidy the requirements.

Actual behavior It failed.

Versions: Please provide the following information:

antoninbas commented 4 years ago

Do you know the steps to reproduce this? I tried the following and it worked fine:

abas@ubuntu:~/vmware/antrea$ cd /tmp/
abas@ubuntu:/tmp$ git clone git@github.com:vmware-tanzu-private/antrea.git
Cloning into 'antrea'...
remote: Enumerating objects: 143, done.
remote: Counting objects: 100% (143/143), done.
remote: Compressing objects: 100% (75/75), done.
remote: Total 2693 (delta 82), reused 105 (delta 66), pack-reused 2550
Receiving objects: 100% (2693/2693), 2.09 MiB | 12.34 MiB/s, done.
Resolving deltas: 100% (1439/1439), done.
abas@ubuntu:/tmp$ cd antrea/
abas@ubuntu:/tmp/antrea$ go mod tidy
go: finding github.com/vmware/octant/pkg/plugin/service/fake latest
go: finding github.com/vmware/octant/pkg/store/fake latest
go: finding github.com/vmware/octant/internal/portforward/fake latest
go: finding github.com/vmware/octant/pkg/plugin/fake latest
go: finding github.com/vmware/octant/pkg/plugin/api/fake latest
go: finding github.com/vmware/octant/internal/cluster/fake latest
go: finding github.com/vmware/octant/internal/module/fake latest
go: finding github.com/vmware/octant/pkg/action/fake latest
go: finding github.com/vmware/octant/pkg/plugin/service latest
go: finding github.com/vmware/octant/pkg/plugin latest
go: finding github.com/vmware/octant/pkg/store latest
go: finding github.com/vmware/octant/internal/portforward latest
go: finding github.com/vmware/octant/pkg/plugin/api latest
go: finding github.com/vmware/octant/internal/cluster latest
go: finding github.com/vmware/octant/internal/module latest
go: finding github.com/vmware/octant/pkg/action latest
go: finding github.com/vmware/octant/pkg latest
go: finding github.com/vmware/octant/internal latest
abas@ubuntu:/tmp/antrea$ git diff
abas@ubuntu:/tmp/antrea$

The output is strange (probably because of the "replace" statement) but the command does not fail.

tnqn commented 4 years ago

The only difference is I checked the repo via https. Did you try it on a new machine? it looks like using cache so might not have this problem

antoninbas commented 4 years ago

Yes that's probably why. I already have all the dependencies in my GOPATH. Let me try in a container.

antoninbas commented 4 years ago

Succeeds inside a fresh container as well. No error after displaying the message "go: finding github.com/vmware/octant v0.9.1". Maybe something else is at play here.

antoninbas commented 4 years ago

I confirmed with @tnqn offline. This is an issue with the Go version (works fine with 1.12 but not with 1.13.4). We need to dig deeper to find out what the root cause is.

To test with Go 1.12:

docker run -w /usr/src/github.com/vmware-tanzu/antrea -v `pwd`:/usr/src/github.com/vmware-tanzu/antrea golang:1.12 go mod tidy

To test with Go 1.13.4:

docker run -w /usr/src/github.com/vmware-tanzu/antrea -v `pwd`:/usr/src/github.com/vmware-tanzu/antrea golang:1.13.4 go mod tidy
antoninbas commented 4 years ago

I have opened an issue with the Octant project: https://github.com/vmware-tanzu/octant/issues/427. I believe they should be checking-in the code generated by mockgen.

antoninbas commented 4 years ago

My Octant PR has been merged in. I am back-porting it to the version of octant we are currently supporting (v0.8) in my fork: https://github.com/antoninbas/octant/tree/release-0.8-antrea