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
Unable to get a working etcd client via go get #12464
Comments
I'm also puzzled about this. Can the documentation be changed in a way that is shows how to import the client that targets a specific etcd version? like, Also, maybe this is related to #12412. @thrawn01, my example at https://github.com/rgl/ubuntu-docker-compose-example/tree/master/hello still works with the versions that are in the go.mod/go.sum file, maybe that's enough for you to get started in the meantime. |
I'm in a similar situation. After switching a project over to gomodules from the old gopath style, I stared having the same type of error: go: finding module for package github.com/coreos/etcd/clientv3/concurrency
go: finding module for package github.com/coreos/etcd/clientv3
go: found github.com/coreos/etcd/clientv3 in github.com/coreos/etcd v3.3.25+incompatible
go: found github.com/coreos/etcd/clientv3/concurrency in github.com/coreos/etcd v3.3.25+incompatible
# github.com/coreos/etcd/clientv3/balancer/picker
../../../../../../go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/err.go:37:44: undefined: balancer.PickOptions
../../../../../../go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/picker/roundrobin_balanced.go:55:54: undefined: balancer.PickOptions
# github.com/coreos/etcd/clientv3/balancer/resolver/endpoint
../../../../../../go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:114:78: undefined: resolver.BuildOption
../../../../../../go/pkg/mod/github.com/coreos/etcd@v3.3.25+incompatible/clientv3/balancer/resolver/endpoint/endpoint.go:182:31: undefined: resolver.ResolveNowOption
So I removed the go.mod entries and changed my imports from: "github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/clientv3/concurrency" to clientv3 "github.com/etcd-io/etcd/client/v3"
"github.com/etcd-io/etcd/client/v3/concurrency" However, that just lead to: > go get go.etcd.io/etcd/client/v3
go: go.etcd.io/etcd/client/v3 upgrade => v3.0.0-20201125202132-28d1af294e43
go get: go.etcd.io/etcd/client/v3@v3.0.0-20201125202132-28d1af294e43 requires
go.etcd.io/etcd/api/v3@v3.5.0-pre: reading go.etcd.io/etcd/api/api/go.mod at revision api/v3.5.0-pre: unknown revision api/v3.5.0-pre |
I made a standalone client here https://github.com/swdee/etcdc for v3.4.13 a few months back due to the issues with Go Modules and GRPC versions. |
managed to get it compile with the following replace section in
The etcd-fix folder my fixed fork of etcd's master branch (at 0539bcb right now) => https://github.com/mcluseau/etcd . Currently, works with a single endpoint and forcing it hard to avoid the balancer layer that does not work: etcd, err := etcdv3.New(etcdCfg)
if err != nil {
return
}
cc, err := etcd.Dial(*etcdEndpoints)
if err != nil {
return
}
etcd.KV = etcdv3.NewKVFromKVClient(etcdserverpb.NewKVClient(cc), etcd)
etcd.Lease = etcdv3.NewLeaseFromLeaseClient(etcdserverpb.NewLeaseClient(cc), etcd, etcdCfg.DialTimeout+time.Second)
etcd.Watcher = etcdv3.NewWatchFromWatchClient(etcdserverpb.NewWatchClient(cc), etcd) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
After following instructions from both
master
and thev3.4.14
tag I am unable to install the etcd client given a clean install environment.v3.4.14 - https://github.com/etcd-io/etcd/blob/v3.4.13/clientv3/README.md#install
master - https://github.com/etcd-io/etcd/blob/master/client/v3/README.md#install
Master
Given the following Dockerfile
The following error results
v3.4.14
Given the following Dockerfile
The following error results
The second error appears to be related to #11563 and #11931.
The fix for this appears to be to use
master
or to cut a v3.5 tag with the associated fix. The master branch appears to do the right thing in respects to mod versioning withclient/v3
etc, I feel like that is the appropriate way for new projects to use the client. However, as noted abovego get go.etcd.io/etcd/client/v3
does not work. I'm assuming this is a transitory problem as the project transitions toclient/v3
. I'm making this issue only to ensure the maintainers are aware of the issue.Thanks for a great project guys!
Full source for my docker files and main.go are here https://github.com/thrawn01/test-etcd
The text was updated successfully, but these errors were encountered: