mw/kubernetes: remove federation and cidr (#916)
* mw/kubernetes: remove federation and cidr Remove both as we have a corefile syntax change that handles cidr and remove federation because that is going to be its own middleware. * backwards incompat changes This PR: * removes cidr from kubernetes (core Corefile feature now) * removes federation from kubernets (comes back as new middleware) * [remove autopath - which was already gone, so that already was backwards incompat] * adds `fallthrough` to the *etcd* middleware and makes you enable it. * Fail on unknown properties * documentation * Disable TestHealthCheck as it uses realtime and fails
This commit is contained in:
parent
818d2b10ad
commit
00f5c7797e
26 changed files with 197 additions and 815 deletions
|
@ -1,33 +0,0 @@
|
|||
package kubernetes
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIsRequestInReverseRange(t *testing.T) {
|
||||
|
||||
tests := []struct {
|
||||
cidr string
|
||||
name string
|
||||
expected bool
|
||||
}{
|
||||
{"1.2.3.0/24", "4.3.2.1.in-addr.arpa.", true},
|
||||
{"1.2.3.0/24", "5.3.2.1.in-addr.arpa.", true},
|
||||
{"5.6.0.0/16", "5.4.6.5.in-addr.arpa.", true},
|
||||
{"1.2.3.0/24", "5.4.2.1.in-addr.arpa.", false},
|
||||
{"5.6.0.0/16", "5.4.2.1.in-addr.arpa.", false},
|
||||
{"5.6.0.0/16", "5.6.0.1.in-addr.arpa.", false},
|
||||
}
|
||||
|
||||
k := Kubernetes{}
|
||||
|
||||
for _, test := range tests {
|
||||
_, cidr, _ := net.ParseCIDR(test.cidr)
|
||||
k.ReverseCidrs = []net.IPNet{*cidr}
|
||||
result := k.isRequestInReverseRange(test.name)
|
||||
if result != test.expected {
|
||||
t.Errorf("Expected '%v' for '%v' in %v.", test.expected, test.name, test.cidr)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue