diff options
author | 2018-11-08 04:53:05 +0800 | |
---|---|---|
committer | 2018-11-07 20:53:05 +0000 | |
commit | bad135cdc577f2aa47712abe4dcc46f65238c776 (patch) | |
tree | 40e21005a4e239baf36c01a7bf7ddc9f7ab0a878 /plugin/kubernetes/autopath.go | |
parent | ae7fbf31d6a5b5689d07c218baf71a3de2dbd3cc (diff) | |
download | coredns-bad135cdc577f2aa47712abe4dcc46f65238c776.tar.gz coredns-bad135cdc577f2aa47712abe4dcc46f65238c776.tar.zst coredns-bad135cdc577f2aa47712abe4dcc46f65238c776.zip |
add opts.initPodCache to avoid panic (#2279)
Automatically submitted.
Diffstat (limited to 'plugin/kubernetes/autopath.go')
-rw-r--r-- | plugin/kubernetes/autopath.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin/kubernetes/autopath.go b/plugin/kubernetes/autopath.go index 71506ee3d..06bde0a69 100644 --- a/plugin/kubernetes/autopath.go +++ b/plugin/kubernetes/autopath.go @@ -15,6 +15,17 @@ func (k *Kubernetes) AutoPath(state request.Request) []string { return nil } + // cluster.local { + // autopath @kubernetes + // kubernetes { + // pods verified # + // } + // } + // if pods != verified will cause panic and return SERVFAIL, expect worked as normal without autopath function + if !k.opts.initPodCache { + return nil + } + ip := state.IP() pod := k.podWithIP(ip) |