plugin/kubernetes: Add noendpoints option (#1536)

* add noendpoints option

* go fmt
This commit is contained in:
Chris O'Haver 2018-02-16 11:05:52 -05:00 committed by John Belamaric
parent 2cad04ec10
commit 9719a47c1b
4 changed files with 96 additions and 15 deletions

View file

@ -92,7 +92,8 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
k8s.autoPathSearch = searchFromResolvConf()
opts := dnsControlOpts{
resyncPeriod: defaultResyncPeriod,
initEndpointsCache: true,
resyncPeriod: defaultResyncPeriod,
}
k8s.opts = opts
@ -221,6 +222,11 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
return nil, c.Errf("transfer from is not supported with this plugin")
}
k8s.TransferTo = tos
case "noendpoints":
if len(c.RemainingArgs()) != 0 {
return nil, c.ArgErr()
}
k8s.opts.initEndpointsCache = false
default:
return nil, c.Errf("unknown property '%s'", c.Val())
}