aboutsummaryrefslogtreecommitdiff
path: root/plugin/k8s_external/setup_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/k8s_external/setup_test.go')
-rw-r--r--plugin/k8s_external/setup_test.go23
1 files changed, 16 insertions, 7 deletions
diff --git a/plugin/k8s_external/setup_test.go b/plugin/k8s_external/setup_test.go
index fde5ca637..351b35a4f 100644
--- a/plugin/k8s_external/setup_test.go
+++ b/plugin/k8s_external/setup_test.go
@@ -8,16 +8,20 @@ import (
func TestSetup(t *testing.T) {
tests := []struct {
- input string
- shouldErr bool
- expectedZone string
- expectedApex string
+ input string
+ shouldErr bool
+ expectedZone string
+ expectedApex string
+ expectedHeadless bool
}{
- {`k8s_external`, false, "", "dns"},
- {`k8s_external example.org`, false, "example.org.", "dns"},
+ {`k8s_external`, false, "", "dns", false},
+ {`k8s_external example.org`, false, "example.org.", "dns", false},
{`k8s_external example.org {
apex testdns
-}`, false, "example.org.", "testdns"},
+}`, false, "example.org.", "testdns", false},
+ {`k8s_external example.org {
+ headless
+}`, false, "example.org.", "dns", true},
}
for i, test := range tests {
@@ -44,5 +48,10 @@ func TestSetup(t *testing.T) {
t.Errorf("Test %d, expected apex %q for input %s, got: %q", i, test.expectedApex, test.input, e.apex)
}
}
+ if !test.shouldErr {
+ if test.expectedHeadless != e.headless {
+ t.Errorf("Test %d, expected headless %q for input %s, got: %v", i, test.expectedApex, test.input, e.headless)
+ }
+ }
}
}