diff options
author | 2017-10-20 22:53:17 +0100 | |
---|---|---|
committer | 2017-10-20 22:53:17 +0100 | |
commit | d64b684831aff2df86d9cea8e23bf57c85b6772f (patch) | |
tree | 7bf9e27b01d11b648255be9dc00e5964747772ba /test/kubernetes_pods_test.go | |
parent | c1f67493de3f13373082ee2e1ec6234c15642854 (diff) | |
download | coredns-d64b684831aff2df86d9cea8e23bf57c85b6772f.tar.gz coredns-d64b684831aff2df86d9cea8e23bf57c85b6772f.tar.zst coredns-d64b684831aff2df86d9cea8e23bf57c85b6772f.zip |
plugin/kubernetes: implement HasSynced() (#1155)
* plugin/kubernetes: wait until api is ready
Wait for HasSynced before allowing startup to avoid startup race.
Also do a small refactor in findServices() to pull a check out of the
loop - only needs to be done once.
* sigh
Diffstat (limited to 'test/kubernetes_pods_test.go')
-rw-r--r-- | test/kubernetes_pods_test.go | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/test/kubernetes_pods_test.go b/test/kubernetes_pods_test.go index 67447f979..345366a41 100644 --- a/test/kubernetes_pods_test.go +++ b/test/kubernetes_pods_test.go @@ -4,7 +4,6 @@ package test import ( "testing" - "time" "github.com/coredns/coredns/plugin/test" @@ -30,11 +29,11 @@ var dnsTestCasesPodsInsecure = []test.Case{ func TestKubernetesPodsInsecure(t *testing.T) { corefile := `.:0 { - kubernetes cluster.local 0.0.10.in-addr.arpa { - endpoint http://localhost:8080 - namespaces test-1 - pods insecure - } +kubernetes cluster.local 0.0.10.in-addr.arpa { + endpoint http://localhost:8080 + namespaces test-1 + pods insecure +} ` server, udp, _, err := CoreDNSServerAndPorts(corefile) @@ -43,9 +42,6 @@ func TestKubernetesPodsInsecure(t *testing.T) { } defer server.Stop() - // Work-around for timing condition that results in no-data being returned in test environment. - time.Sleep(3 * time.Second) - for _, tc := range dnsTestCasesPodsInsecure { c := new(dns.Client) @@ -92,9 +88,6 @@ func TestKubernetesPodsVerified(t *testing.T) { } defer server.Stop() - // Work-around for timing condition that results in no-data being returned in test environment. - time.Sleep(3 * time.Second) - for _, tc := range dnsTestCasesPodsVerified { c := new(dns.Client) |