Commit graph

26 commits

Author SHA1 Message Date
Chris O'Haver
353c1c6487 Fix k8s chaining (#510)
* fix k8s next middleware chaining

* add chain to integration tests

* if nit
2017-02-08 12:53:55 -05:00
Chris O'Haver
4b6860fc81 Fix k8s PTR when all namespaces exposed (#507)
* check for no namespace filter

* integration test
2017-02-07 16:22:43 -05:00
Chris O'Haver
77f957d443 k8s middleware add tests and docs update (#501)
* add cidrs opt

* remove state data from middleware object

* update k8s docs

* Add integration tests

* add unit tests for cidr and pods config

* more README fixes, separate dev notes

* adjust section headers

* fix typo
2017-02-02 16:51:42 -05:00
Chris O'Haver
c62bd639ff correct k8s name parsing response codes (#493) 2017-01-23 20:11:32 +00:00
Chris O'Haver
adfd7d5b19 Add pod cache and verified pod responses (#483)
* Add pod cache and verified pod responses

* add ip indexing for pod cache
2017-01-20 07:22:11 +00:00
Chris OHaver
2d0b8293a4 Add txt response per k8s spec 2017-01-15 14:37:18 +00:00
Chris O'Haver
a6d232a622 dont require/allow "_" prefix for srv wildcard fields (#472)
* dont require/allow "_" prefix for srv wildcard fields

* streamline parse/validation of req name

* removing nametemplate

* error when zone not found, loopify unit tests
2017-01-15 08:12:28 +00:00
Chris O'Haver
b6a2a5aeaa Pod insecure2 (#479)
* return servfail for pod rqsts when pods disabled

* Add integration test for disabled pod mode
2017-01-12 11:57:00 -05:00
Miek Gieben
94c59da577 Run tests in parallel (#478)
Create a small speedup running the tests:

PASS
ok  	github.com/miekg/coredns/test	10.329s

PASS
ok  	github.com/miekg/coredns/test	6.079s

Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield
any speedup as these are still done on a per directory basis.
2017-01-12 08:13:50 +00:00
Chris O'Haver
0ee88d3007 Add insecure A records for pods (#475) 2017-01-11 21:23:10 +00:00
Chris O'Haver
9a5e0c64fd handle A/PTR/SRV for headless services/endpoints (#464)
* handle A/PTR/SRV for headless services/endpoints

* error early if _proto will produce nothing

* remove wc params + various style tweaks

* Release 004

* handle A/PTR/SRV for headless services/endpoints

* error early if _proto will produce nothing

* remove wc params + various style tweaks

* optimize srv prefix validation

* poking travis

* reduce response sizes, clean func params
2017-01-05 15:09:59 +00:00
Chris O'Haver
56d3b47d11 Add A lookup for headless services (#451) 2016-12-02 22:50:01 +00:00
John Belamaric
7e93746083 Fix reverse zone in corefile 2016-11-15 15:03:49 +00:00
John Belamaric
99b60d2966 Change IPs to match hyperkube 2016-11-15 14:25:37 +00:00
John Belamaric
afe4368c34 K8s Test Cleanup and Service PTR
Change the CI setup for K8s to be simpler. Now it just creates a
set of objects via a yaml file, making it very easy to modify
the tests.

Implement PTR for services.
2016-11-15 01:35:24 +00:00
Chris O'Haver
96206cdbc3 Return NXDOMAIN when no items match query (#422)
* When no records match, reply with NXDOMAIN

* Implement in IsNameError

* case for unexposed namespace. k8s integation tests

* Fix imports order. Lower case of err strs.
2016-11-10 21:24:06 +00:00
Chris O'Haver
5f55cd6dad Update k8s integration tests 2016-11-09 21:07:27 +00:00
John Belamaric
229c82c418 Fix k8s client (#379)
* Fix k8s client to use client-go

* Fix Kubernetes Build Issue

The client-go code requires you to vendor. I have done a hack here
in the Makefile to vendor it to version 1.5. But looks like we
will need to do this the 'right' way soon.

* Convert v1 to api Objects in List Functions

Also removed the endpoint controller which was not used for anything.
The Watch functions may still need the same treatment.

* Vendor client-go release-1.5

* Fix basic SRV feature

This is actually not serving SRV records correctly, but this should
get it to work as it did prior to the k8s client changes. Another
fix will be needed to serve SRV records as defined in the spec.

* Add additional output in test result

Add the response to the test output.

* Fix erroneous test data
2016-11-05 11:57:08 +00:00
Miek Gieben
e54c232c8c middleware/cache: split cache in positive and negative and use lru (#298)
Make the cache memory bounded, by using a LRU cache. Also split the
cache in a positive and negative one - each with its own controls.

Extend the cache stanza to allow for this:

    cache {
       positive limit [ttl]
       negative limit [ttl]
    }

is now possible. This also add a cache_test.go in the toplevel test/
directory that exercises the caching path.

Fixes #260
2016-10-02 08:31:44 +01:00
Yong Tang
9b6b8d2762 Cleanup Makefile and .travis.yml (#305)
This fix updates .travis.yml and Makefile for several places:
- Remove unneeded `docker pull gcr.io/google_containers/hyperkube-amd64:v1.2.4` (only v1.3.7 was used)
- Use docker to deploy etcd (insteadof downloading etcd binary).
- Merge `make testk8s` and `make testk8s-setup` (no need to have multiple targets for a couple of tests)
- Set version of etcd and kubernetes in .travis.yml (so that it is easy to update new version in the future)

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-09-27 07:57:04 +08:00
Michael Richmond
2153d2defd Fix k8s integration tests (#231)
* Adding debug message when starting k8s controller

* Adding work-around for timing issue in k8s integration tests

* Remove unused import

* Fix Makefile for ast package

* Increase k8s verbosity in travis

* Updating TODO list to find root cause of test issue

* go fmt cleanup
2016-08-23 07:15:21 +01:00
Miek Gieben
416603383d Cleanup and fixes (#223)
* Set version to 001
* Remove k8stest, test fails is k8s is not there: touch luck
* Remove server directory: not used anymore
* Disable k8s test (for now)
* gometalinter changes
2016-08-20 23:03:36 +01:00
Miek Gieben
9ac3cab1b7 Make CoreDNS a server type plugin for Caddy (#220)
* Make CoreDNS a server type plugin for Caddy

Remove code we don't need and port all middleware over. Fix all tests
and rework the documentation.

Also make `go generate` build a caddy binary which we then copy into
our directory. This means `go build`-builds remain working as-is.

And new etc instances in each etcd test for better isolation.
Fix more tests and rework test.Server with the newer support Caddy offers.

Fix Makefile to support new mode of operation.
2016-08-19 17:14:17 -07:00
Michael Richmond
8dec292668 Fix Travis IPv6 and add k8s integration testing to CI (#194)
Updating travis yaml file to:
* Force IPv6 to work in their VM environment
* Enable docker (requires VM environment and sudo)
* Run kubernetes integration tests in Travis
2016-07-27 10:01:24 -07:00
Michael Richmond
4a3b57d81b Adding test cases for Corefile parsing (#193)
Adding test cases for Corefile parsing.
Some code refactoring to allow test reuse.
2016-07-22 16:07:27 -07:00
Michael Richmond
3f4ec783d2 Adding wildcard support (#190)
* Commenting out unused functions. TODO: remove when it is not needed

* Update README with namespace and template example

* Adding note about changing the record name format via a template

* Adding test scripts to automate k8s startup

* Automating k8s namespace creation

* Adding automation to start 4 k8s services

* Updating documentation for k8s tests

* Avoid downloading kubectl if already exists

* Adding debug statement when namespace is not exposed.

* Adding basic kubernetes integration tests

* Makefile now contains a "testk8s" target. This target requires k8s to
  be running.
* Adding test/kubernetes_test.go file with a couple of basic A record
  tests.

* Updating k8s integration tests to only run k8s integration tests

* Adding support for namespace wildcards

* Refactoring to move filtering logic to kubernetes.go file

* go fmt fixes

* Adding wildcard support for namespaces and service names

* Kubernetes integration tests updated for A records.
* Expanded record name assembly for answer section not yet implemented.
* Refactoring to focus k8sclient code just on accessing k8s API.
 Filtering now handled in kubernetes.go

* Adding wildcard test cases

* Adding skydns startup script. (To allow side by side testing of wildcards.)
* Commenting out record name assmebly based on NameTemplate. Need to improve template before this makes sense.

* Adding basic SRV integration tests

* Need to add verification for additional answer section

* Fixing comments and formatting

* Moving wildcard constants to vars

* Travis test execution appears to be failing on access to these
 constants

* Fixing access to util package

* Trying to work around Travis test bug

* Reverting to access kubernetes/util as "util"

Travis breakage is due to "Infoblox-CTO" in src path
2016-07-14 23:50:14 +02:00