support etcd credentials in etcd plugin (#2442)

* support etcd credentials in etcd plugin

fixes #2441

* try to fix cleanup of authentication
This commit is contained in:
Christophe de Carvalho
2019-02-01 16:30:53 +01:00
committed by Miek Gieben
parent b455f86824
commit d878eeebbb
6 changed files with 156 additions and 14 deletions

View File

@@ -23,6 +23,16 @@ func etcdPlugin() *etcd.Etcd {
return &etcd.Etcd{Client: cli, PathPrefix: "/skydns"}
}
func etcdPluginWithCredentials(username, password string) *etcd.Etcd {
etcdCfg := etcdcv3.Config{
Endpoints: []string{"http://localhost:2379"},
Username: username,
Password: password,
}
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
// will then test if we detect this loop.
func TestEtcdStubLoop(t *testing.T) {