Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-controller: Require go 1.15, run go mod tidy and go mod vendor #2303

Closed
wants to merge 1 commit into from

Conversation

andreaskaris
Copy link
Collaborator

@andreaskaris andreaskaris commented Jul 4, 2021

Require go 1.15, run go mod tidy and go mod vendor, additionally,
update the README

In earlier versions of go, this will still fail early when it attempts
compilation of github.com/ovn-org/libovsdb

Fixes #2243

Signed-off-by: Andreas Karis ak.karis@gmail.com

- What this PR does and why is it needed

- Special notes for reviewers

- How to verify it

- Description for the changelog

Require go 1.15, run go mod tidy and go mod vendor, additionally,
update the README

In earlier versions of go, this will still fail early when it attempts
compilation of github.com/ovn-org/libovsdb

Fixes issue ovn-org#2243

Signed-off-by: Andreas Karis <ak.karis@gmail.com>
@andreaskaris
Copy link
Collaborator Author

So, I retested this and instead now it fails on:

[root@ovnkubernetes go-controller]# make
hack/build-go.sh cmd/ovnkube cmd/ovn-k8s-cni-overlay cmd/ovn-kube-util hybrid-overlay/cmd/hybrid-overlay-node cmd/ovndbchecker cmd/ovnkube-trace
grep: github.com/ovn-org/ovn-kubernetes/go-controller/go.sum: No such file or directory
+ for bin in "$@"
++ basename cmd/ovnkube
+ binbase=ovnkube
+ CGO_ENABLED=1
+ '[' ovnkube = ovn-k8s-cni-overlay ']'
+ env CGO_ENABLED=1 go build -v -mod vendor -gcflags '' -ldflags '-B 0x960fd362a7cb76a240590f8767a57fa6da26ed4a                 -X github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config.Commit=33dbced8ac7c9778db69eca5d34d40b29e57d4af                 -X github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config.Branch=master                 -X github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config.BuildUser=root                 -X github.com/ovn-org/ovn-kubernetes/go-controller/pkg/config.BuildDate=2021-07-04                 -X k8s.io/client-go/pkg/version.gitVersion=' -o /root/ovn-kubernetes/go-controller/_output/go/bin/ovnkube ./cmd/ovnkube
github.com/ovn-org/libovsdb/client
# github.com/ovn-org/libovsdb/client
vendor/github.com/ovn-org/libovsdb/client/client.go:116:14: undefined: tls.Dialer
make: *** [Makefile:35: all] Error 1

That's regardless of the proposed changes.

The problem is that in May, this new dependency was introduced to vendor/github.com/ovn-org/libovsdb and the minimum go version for that dependency is go1.16. Hence, inclusion of github.com/ovn-org/libovsdb 0.5.0 should bump the required go version to 1.16 IMO:

https://github.com/ovn-org/libovsdb/blob/b6a89b4aebb68d1e018fd442aed0df0023e2f631/go.mod#L3

module github.com/ovn-org/libovsdb

go 1.16

require (
	github.com/cenk/hub v1.0.1 // indirect
	github.com/cenkalti/hub v1.0.1 // indirect
	github.com/cenkalti/rpc2 v0.0.0-20210220005819-4a29bc83afe1
	github.com/google/uuid v1.2.0
	github.com/stretchr/testify v1.6.1
)

Somehow, that go.mod file is not pulled in, though, and it compiles fine in go 1.15, anyway.
I think this is related to the discussion in: golang/go#42970 and the developers decided to pull go.mod files in the vendor directory altogether starting with 1.17 (golang/go@eb71887)

I bumped the required version to 1.15 and adjusted the README, but because of the above, this still fails on compilation of the vendor module before it takes into account the actual requirement for go 1.15.

However, I still think it's worth bumping the version so that humans get a cluster about what's wrong when looking at the README or go.mod

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 53.769% when pulling aabf4d8 on andreaskaris:issue2243 into 33dbced on ovn-org:master.

@trozet trozet closed this Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project fails to compile with go 1.14
3 participants