mirror of
https://github.com/coredns/coredns.git
synced 2025-12-08 03:15:41 -05:00
kubernetes: Add zone filtering to fallthrough (#1353)
* Add zone filtering to fallthrough * Doh. gofmt * Update documentation
This commit is contained in:
@@ -1 +1,21 @@
|
||||
package plugin
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFallthrough(t *testing.T) {
|
||||
if Fallthrough(nil, "foo.com.") {
|
||||
t.Errorf("Expected false, got true for nil fallthrough")
|
||||
}
|
||||
|
||||
if !Fallthrough(&[]string{}, "foo.net.") {
|
||||
t.Errorf("Expected true, got false for all zone fallthrough")
|
||||
}
|
||||
|
||||
if Fallthrough(&[]string{"foo.com", "bar.com"}, "foo.net") {
|
||||
t.Errorf("Expected false, got true for non-matching fallthrough zone")
|
||||
}
|
||||
|
||||
if !Fallthrough(&[]string{"foo.com.", "bar.com."}, "bar.com.") {
|
||||
t.Errorf("Expected true, got false for matching fallthrough zone")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user