-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for etcd client version 3 #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great contribution!
Please, check my comments
HI, thanks for you PR review, I have solved, See the commits. |
@khvysofq I've added two more comments regarding two minor details and I think it's almost ready to be merged. Again, thanks for the contribution to the project |
The KrakenD is a very promising project . I am honored to contribute to this project. Anyway if you have any suggestions for this PR, please point it out. I want do it better as krakenD project do. |
Hi, kpacha. This PR is primarily to support the functionality of the ETCD clientv3. The major changes are as follows
clientv3.go
、clientv3_testing.go
in the root of the source code.config.go
Both modes are supported through profile configuration, just add
"client_version": "v3"
option inextra_config
"client_version": "v3"
using the etcd clientv3"client_version": "v2"
using the etcd clientv2 (old version)The default value is
v2
, if you are not set"client_version"
. I have tested in my local machines.Among other things, there is one small problem. I used go mod to manage my go packages. but in the original code of the
example/main.go
, thejackfan.us.kg/devopsfaith/krakend-etcd
(v 3.3.10 or newer version) andjackfan.us.kg/devopsfaith/krakend-viper
conflict when load packagejackfan.us.kg/ugorji/go
github.com/devopsfaith/krakend-etcd
(v 3.3.12) needjackfan.us.kg/ugorji/[email protected]
github.com/devopsfaith/krakend-viper
auto needjackfan.us.kg/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8
They need the same package, but not the same directory and not the same version. The go mod can't handle this situation. see spf13/viper#658
So, in the
example/main.go
, I can only changejackfan.us.kg/devopsfaith/krakend-viper
tojackfan.us.kg/devopsfaith/krakend/config