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

client/v2: remove unsafe json-iterator/reflect2 #13439

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

chaochn47
Copy link
Member

Fix #13434

In addition to the reasons listed in #13434, the libraries were introduced by #10667 and driven by kubernetes usage.

PTAL @liggitt

/cc @hexfusion

@liggitt
Copy link
Contributor

liggitt commented Oct 25, 2021

looks like the library requires go1.17+

@hexfusion
Copy link
Contributor

cc @lilic I believe you were working on go 1.17 bump?

@chaochn47
Copy link
Member Author

xref. #13314 ^

@lilic
Copy link
Contributor

lilic commented Oct 25, 2021

Yes, let me open that PR. I was waiting for another go.mod related PR to merge and it seems it has.

@lilic
Copy link
Contributor

lilic commented Oct 26, 2021

Opened #13440.

@lilic
Copy link
Contributor

lilic commented Oct 27, 2021

The other PR that bumps go versions got merged.

@chaochn47 chaochn47 force-pushed the remove_json_iterator_reflect2 branch from 47e72b2 to a88e2ed Compare October 27, 2021 18:05
api/go.mod Outdated
@@ -11,13 +11,6 @@ require (
google.golang.org/grpc v1.41.0
)

require (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go mod tidy as part of ./scripts/fix.sh removes the indirect ones..

Copy link
Contributor

@lilic lilic Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, it doesn't do that for me 🤔 Which version of go are you using locally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I was using go 1.16. Updated the latest go.mod after upgrading to 1.17

@chaochn47 chaochn47 force-pushed the remove_json_iterator_reflect2 branch from a88e2ed to 641976d Compare November 2, 2021 06:47
@chaochn47 chaochn47 force-pushed the remove_json_iterator_reflect2 branch from 641976d to b5e4c2d Compare November 9, 2021 19:16
@chaochn47
Copy link
Member Author

Previous CI failed on 'bom' ref. https://github.com/etcd-io/etcd/runs/4079040518?check_suite_focus=true

Latest force commit fixed it and verified locally.

GOARCH=amd64 PASSES='bom dep' ./test.sh
Running with --race
Starting at: Tue Nov  9 19:15:51 UTC 2021

'bom' started at Tue Nov  9 19:15:51 UTC 2021
Checking bill of materials...
% cp go.sum go.sum.tmp
% cp go.mod go.mod.tmp
% (cd tools/mod && gobin -p -m --mod=readonly github.com/coreos/license-bill-of-materials)
% /home/chaochn/workplace/EKS-etcd/src/etcd/tools/mod/.gobincache/github.com/coreos/license-bill-of-materials/@v/v0.0.0-20190913234955-13baff47494e/license-bill-of-materials --override-file ./bill-of-materials.override.json go.etcd.io/etcd/api/v3/... go.etcd.io/etcd/pkg/v3/... go.etcd.io/etcd/raft/v3/... go.etcd.io/etcd/client/pkg/v3/... go.etcd.io/etcd/client/v2/... go.etcd.io/etcd/client/v3/... go.etcd.io/etcd/server/v3/... go.etcd.io/etcd/etcdutl/v3/... go.etcd.io/etcd/etcdctl/v3/... go.etcd.io/etcd/tests/v3/... go.etcd.io/etcd/v3/...
% cp go.sum.tmp go.sum
% cp go.mod.tmp go.mod
'bom' completed at Tue Nov  9 19:15:55 UTC 2021

'dep' started at Tue Nov  9 19:15:55 UTC 2021
% (cd api && go list -m)
% (cd api && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/api/v3{{end}}{{end}} -m all)
% (cd pkg && go list -m)
% (cd pkg && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/pkg/v3{{end}}{{end}} -m all)
% (cd raft && go list -m)
% (cd raft && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/raft/v3{{end}}{{end}} -m all)
% (cd client/pkg && go list -m)
% (cd client/pkg && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/client/pkg/v3{{end}}{{end}} -m all)
% (cd client/v2 && go list -m)
% (cd client/v2 && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/client/v2{{end}}{{end}} -m all)
% (cd client/v3 && go list -m)
% (cd client/v3 && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/client/v3{{end}}{{end}} -m all)
% (cd server && go list -m)
% (cd server && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/server/v3{{end}}{{end}} -m all)
% (cd etcdutl && go list -m)
% (cd etcdutl && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/etcdutl/v3{{end}}{{end}} -m all)
% (cd etcdctl && go list -m)
% (cd etcdctl && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/etcdctl/v3{{end}}{{end}} -m all)
% (cd tests && go list -m)
% (cd tests && go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/tests/v3{{end}}{{end}} -m all)
% go list -m
% go list -f {{if not .Indirect}}{{if .Version}}{{.Path}},{{.Version}},go.etcd.io/etcd/v3{{end}}{{end}} -m all
SUCCESS: dependencies are consistent across modules
'dep' completed at Tue Nov  9 19:16:06 UTC 2021
SUCCESS

Copy link
Contributor

@hexfusion hexfusion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @chaochn47 !

@hexfusion hexfusion merged commit 15b0820 into etcd-io:main Nov 9, 2021
@chaochn47 chaochn47 deleted the remove_json_iterator_reflect2 branch November 9, 2021 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Remove use of unsafe json-iterator / reflect2 libraries
4 participants