diff options
author | 2018-06-30 20:49:13 +0530 | |
---|---|---|
committer | 2018-06-30 16:19:13 +0100 | |
commit | 6fe27d99be622f69ac0b1d402a67a571c6f6166e (patch) | |
tree | 8ad19accd3f1a59137b3116396518c1031bb4701 /test | |
parent | f3afd700210ffee655672b90b8cb78698f1d9e42 (diff) | |
download | coredns-6fe27d99be622f69ac0b1d402a67a571c6f6166e.tar.gz coredns-6fe27d99be622f69ac0b1d402a67a571c6f6166e.tar.zst coredns-6fe27d99be622f69ac0b1d402a67a571c6f6166e.zip |
plugin/etcdv3: Add etcd v3 plugin (#1702)
* Update dependencies and add etcdv3 client
* Update etcd plugin to support etcd v3 clients
Fixes #341
Diffstat (limited to 'test')
-rw-r--r-- | test/etcd_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/etcd_test.go b/test/etcd_test.go index da9992a0d..2077ca985 100644 --- a/test/etcd_test.go +++ b/test/etcd_test.go @@ -16,17 +16,16 @@ import ( "github.com/coredns/coredns/plugin/test" "github.com/coredns/coredns/request" - etcdc "github.com/coreos/etcd/client" + etcdcv3 "github.com/coreos/etcd/clientv3" "github.com/miekg/dns" ) func etcdPlugin() *etcd.Etcd { - etcdCfg := etcdc.Config{ + etcdCfg := etcdcv3.Config{ Endpoints: []string{"http://localhost:2379"}, } - cli, _ := etcdc.New(etcdCfg) - client := etcdc.NewKeysAPI(cli) - return &etcd.Etcd{Client: client, PathPrefix: "/skydns"} + cli, _ := etcdcv3.New(etcdCfg) + return &etcd.Etcd{Client: cli, PathPrefix: "/skydns"} } // This test starts two coredns servers (and needs etcd). Configure a stubzones in both (that will loop) and @@ -94,11 +93,11 @@ func set(ctx context.Context, t *testing.T, e *etcd.Etcd, k string, ttl time.Dur t.Fatal(err) } path, _ := msg.PathWithWildcard(k, e.PathPrefix) - e.Client.Set(ctx, path, string(b), &etcdc.SetOptions{TTL: ttl}) + e.Client.KV.Put(ctx, path, string(b)) } // Copied from plugin/etcd/setup_test.go func delete(ctx context.Context, t *testing.T, e *etcd.Etcd, k string) { path, _ := msg.PathWithWildcard(k, e.PathPrefix) - e.Client.Delete(ctx, path, &etcdc.DeleteOptions{Recursive: false}) + e.Client.Delete(ctx, path) } |