reset servers list if service not resolved
@@ -134,8 +134,13 @@ func main() {
newPeers, err = lookup(*svc)
if err != nil {
log.Printf("%v", err)
+
+ if lerr, ok := err.(*net.DNSError); ok && lerr.IsNotFound {
+ // Service not resolved - no endpoints, so reset peers list
+ peers = sets.NewString()
continue
}
+ }
peerList := newPeers.List()
sort.Strings(peerList)
if strings.Join(peers.List(),":") != strings.Join(newPeers.List(),":") {
