aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/apiproxy.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-10-20 22:53:17 +0100
committerGravatar GitHub <noreply@github.com> 2017-10-20 22:53:17 +0100
commitd64b684831aff2df86d9cea8e23bf57c85b6772f (patch)
tree7bf9e27b01d11b648255be9dc00e5964747772ba /plugin/kubernetes/apiproxy.go
parentc1f67493de3f13373082ee2e1ec6234c15642854 (diff)
downloadcoredns-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 'plugin/kubernetes/apiproxy.go')
-rw-r--r--plugin/kubernetes/apiproxy.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugin/kubernetes/apiproxy.go b/plugin/kubernetes/apiproxy.go
index 196ca5e60..59a569885 100644
--- a/plugin/kubernetes/apiproxy.go
+++ b/plugin/kubernetes/apiproxy.go
@@ -65,7 +65,9 @@ func (p *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (p *apiProxy) Run() {
p.handler.Start()
- p.Serve(p.listener)
+ go func() {
+ p.Serve(p.listener)
+ }()
}
func (p *apiProxy) Stop() {