mw/kubernetes: add reverse_test.go (#922)

This PR adds a reverse tests that copies some of it from the main
integration test. This aids in local testing because you don't need
a full k8s setup running.

It does the most minimal testing, a successful return and a nodata
response that includes the SOA for in-addr.arpa.
This commit is contained in:
Miek Gieben 2017-08-16 07:33:35 +01:00 committed by GitHub
parent 479c8bbaa9
commit 06644c2855
4 changed files with 150 additions and 19 deletions

View file

@ -44,7 +44,6 @@ type Kubernetes struct {
LabelSelector *unversionedapi.LabelSelector
Selector *labels.Selector
PodMode string
ReverseCidrs []net.IPNet
Fallthrough bool
primaryZoneIndex int
@ -297,7 +296,6 @@ func (k *Kubernetes) Records(name string, exact bool) ([]msg.Service, error) {
// just this name. This is used when find matches when completing SRV lookups
// for instance.
func (k *Kubernetes) Entries(r recordRequest) ([]msg.Service, error) {
// Abort if the namespace does not contain a wildcard, and namespace is not published per CoreFile
// Case where namespace contains a wildcard is handled in Get(...) method.
if (!wildcard(r.namespace)) && (len(k.Namespaces) > 0) && (!dnsstrings.StringInSlice(r.namespace, k.Namespaces)) {