From bad135cdc577f2aa47712abe4dcc46f65238c776 Mon Sep 17 00:00:00 2001 From: DavadDi Date: Thu, 8 Nov 2018 04:53:05 +0800 Subject: [PATCH] add opts.initPodCache to avoid panic (#2279) Automatically submitted. --- plugin/kubernetes/autopath.go | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)