Feature/etcd3 support with tests#308
Conversation
Update our nokia/skydns repo to the skydns' repo
miekg
left a comment
There was a problem hiding this comment.
Nice and thank you!
Bunch of comments.
| "fmt" | ||
| "github.com/coreos/etcd/mvcc/mvccpb" | ||
| "encoding/json" | ||
| //"github.com/skynetservices/skydns/backends/etcd" |
There was a problem hiding this comment.
arrgh, yea my bad, missed deleting that one.
| } | ||
|
|
||
| func (g *Backendv3) Records(name string, exact bool) ([]msg.Service, error) { | ||
|
|
There was a problem hiding this comment.
hmmm, whitespace is not but clutters this PR a bit.
There was a problem hiding this comment.
okay will remove the whitespaces a bit
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if resp == nil { |
There was a problem hiding this comment.
why this? Isn't err != nil enough to bail out. Why not?
| if w == "*" || w == "any"{ | ||
| return true; | ||
| } | ||
| if keyParts[i] != w && (!(w == "*" || w == "any")) { |
There was a problem hiding this comment.
I find this hard to parse, can we just add another if statement?
| Nodes: | ||
| for _, item := range kv { | ||
|
|
||
| s := string(item.Key[:]) |
| } | ||
|
|
||
| const ( | ||
| KEYNOTFOUND = 100 |
There was a problem hiding this comment.
Can you add a comment where this value comes from?
Also, go nit, use CamelCase. And does it need to be exported?
There was a problem hiding this comment.
The value is arbitrary, so to respect on what skydns has been using with etcdv2 I used the value of 100.
| etcd "github.com/coreos/etcd/client" | ||
| "github.com/coreos/go-systemd/activation" | ||
| "github.com/miekg/dns" | ||
| etcd3 "github.com/skynetservices/skydns/backends/etcd3" |
There was a problem hiding this comment.
please sort this with the other skydns imports.
There was a problem hiding this comment.
Ahhh noticed just now, it is sorted alphabetically. Okay will do
| // etcNameError return a NameError to the client if the error | ||
| // returned from etcd has ErrorCode == 100. | ||
| func isEtcdNameError(err error, s *server) bool { | ||
| func verdictEtcdV2(err error, s *server) bool { |
| return false | ||
| } | ||
|
|
||
| func verdictEtcdV3(err error, s *server) bool { |
|
updated with cleanup based on comments. |
etcd3-support feature tests.
fully utilizes the ones available in the server_test.go for etcdv2.
Also included are bug fixes for the ones caught by the testcases.
PS:
with this we would need etcd v3 running in Travis.