aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/reverse_test.go (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-10-10use keys (#2167)Gravatar Chris O'Haver 1-37/+31
2018-10-09plugin/kubernetes: allow trimming down of cached items. (#2128)Gravatar Miek Gieben 1-70/+37
* Convert to runtime.Object to smaller structs This adds conversion for all the objects we want to keep in the cache. It keeps the minimum for CoreDNS to function and throws away the rest. The conversion: api.Endpoints -> object.Endpoints api.Pod -> object.Pod api.Serivce -> object.Service We needed to copy some client-go stuff to insert a conversion function into NewIndexInformers. Some unrelated cleanups in the watch functionality as that needed to be touched because of the above translation of objects. Signed-off-by: Miek Gieben <miek@miek.nl> * Reduce test line-count Signed-off-by: Miek Gieben <miek@miek.nl> * ....and fix test Signed-off-by: Miek Gieben <miek@miek.nl> * Drop use of append Signed-off-by: Miek Gieben <miek@miek.nl> * cosmetic changes Signed-off-by: Miek Gieben <miek@miek.nl> * that was a typo Signed-off-by: Miek Gieben <miek@miek.nl> * re-introduce append here We can't really use len() here because we don't know the number before hand. Signed-off-by: Miek Gieben <miek@miek.nl> * comment in better place Signed-off-by: Miek Gieben <miek@miek.nl> * Make the timestamp a bool; thats where it is used for Signed-off-by: Miek Gieben <miek@miek.nl> * Set incoming object to nil Explicataliy discard the converted object; we did a deep copy it's not needed anymore. Signed-off-by: Miek Gieben <miek@miek.nl> * Per Chris's comment Signed-off-by: Miek Gieben <miek@miek.nl>
2018-06-27Watch feature (#1527)Gravatar John Belamaric 1-0/+4
* Add part 1 watch functionality. (squashed) * add funcs for service/endpoint fqdns * add endpoints watch * document exposed funcs * only send subset deltas * locking for watch map * tests and docs * add pod watch * remove debugs prints * feedback part 1 * add error reporting to proto * inform clients of server stop+errors * add grpc options param * use proper context * Review feedback: * Removed client (will move to another repo) * Use new log functions * Change watchChan to be for string not []string * Rework how k8s plugin stores watch tracking info to simplify * Normalize the qname on watch request * Add blank line back * Revert another spurious change * Fix tests * Add stop channel. Fix tests. Better docs for plugin interface. * fmt.Printf -> log.Warningf * Move from dnsserver to plugin/pkg/watch * gofmt * remove dead client watches * sate linter * linter omg
2018-04-22all: fix plugin import ordering (#1717)Gravatar Miek Gieben 1-2/+1
Got a bit messed up with stb lib "context" usage.
2018-04-20global: move to context (#1699)Gravatar Miek Gieben 1-1/+2
* global: move to context Move from golang.org/x/net/context to std lib's context. Change done with: for i in $(grep -l '/context' **/*.go); do sed -e 's|golang.org/x/net/context|context|' -i $i; echo $i; done for i in **/*.go; do goimports -w $i; done * drop from dns.pb.go as well
2018-02-28plugin/kubernetes: PTR/A reverse query corner cases (#1551)Gravatar Chris O'Haver 1-1/+45
* better handle non PTR rev zone qrys * vice versa * tests * comment typo * much cleaner
2018-02-13fix ptr nxdomain response and test (#1524)Gravatar Chris O'Haver 1-1/+1
2018-02-08support for zone transfer for kubernetes (#1259)Gravatar Brad Beam 1-0/+1
* plugin/kubernetes: axfr Hook up dynamic SOA serial by setting ResourceEventHandlerFuncs in dnsController. Add prototype of returns msg.Services via the Transfer function. Leave expanding this to RRs out of scope for a bit. * plugin/kubernetes: axfr Respond to AXFR queries * Fixing race condition * Fixing instantiation of dnstest writer * Updates from review
2018-01-23fix computation of reverse zone based on Ipv6 CIDRs (#1415)Gravatar Francois Tur 1-1/+25
2018-01-03Update k8s client-go to v6.0.0 (#1340)Gravatar Yong Tang 1-1/+1
* Update k8s client-go to v6.0.0 This fix updates k8s client-go to v6.0.0 as CoreDNS is supported in 1.9 and v6.0.0 is the recommended version. There are quite some massive changes that need to be made: 1. k8s.io/client-go/pkg/api/v1 has been changed to k8s.io/api/v1 (repo changed from `client-go` to `api`) 2. kubernetes.Clientset adds one extra layer, so that `kubernetes.Clientset.Services()` and like has been changed to `kubernetes.Clientset.CoreV1().Services()` Also, we have to stick with specific commits of `k8s.io/apimachinery` and the newly introduced `k8s.io/api` because go dep still could not figure out the right version to fetch. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update vendor with `dep ensure --update` and `dep prune` Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-11-16plugin/k8s: ipv6 UT for endpoint (#1243)Gravatar Chris O'Haver 1-2/+16
* ipv6 UT for endpoint * tweak
2017-11-15plugin/kubernetes: Fix reverse TTL response (#1240)Gravatar Miek Gieben 1-2/+2
Remove most 303 TTLs (those get skipped by the test) and use 5, which is the default for all tests.
2017-11-13plugin/kubernetes: correctly set NODATA for ns (#1229)Gravatar Miek Gieben 1-0/+8
* plugin/kubernetes: Add GetNamespaceByName A bare or wildcard query for just the namespace should return NODATA, not NXDOMAIN, otherwise we deny the entirety of the names under the namespace. Add test to check for this in pod verified mode. * Review More comments and move namespace code to namespace.go
2017-11-10plugin/k8s: Use service IP index in reverse lookups (#1212)Gravatar Chris O'Haver 1-11/+24
* use index for svc reverse lookup * temp revert * restore reverse.go * restore reverse_test.go
2017-10-20plugin/kubernetes: implement HasSynced() (#1155)Gravatar Miek Gieben 1-0/+1
* plugin/kubernetes: wait until api is ready Wait for HasSynced before allowing startup to avoid startup race. Also do a small refactor in findServices() to pull a check out of the loop - only needs to be done once. * sigh
2017-10-17Plugin/Kubernetes: Service and Endpoint Indexing (#1149)Gravatar Sandeep Rajan 1-4/+8
* indexing * corrections
2017-09-29plugin/kubernetes: Enable protobuf, Update client api package (#1114)Gravatar Chris O'Haver 1-29/+29
* vendor * code
2017-09-21pkg: add dnstest (#1098)Gravatar Miek Gieben 1-2/+2
Add a full test server impl in this new package + tests. Move dnsrecorder into this package as well and finish up the commented out tests that were left in the old dnsrecorder package. Update all callers and tests.
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 1-0/+125
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat