mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
ADD ignoreemptyservice option for kubernetes plugin (#1813)
* ADD: ignoreemptyservice option for kubernetes plugin * Modify documentation and rename option to add space * UPD: Add unit tests * UPD: gofmt * Add unit test for ignore emptyservice * gofmt * xfr tests failed * Rename emptyservice to empty_service
This commit is contained in:
committed by
Chris O'Haver
parent
0f74281a53
commit
003e104fca
@@ -115,6 +115,7 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
|
||||
|
||||
opts := dnsControlOpts{
|
||||
initEndpointsCache: true,
|
||||
ignoreEmptyService: false,
|
||||
resyncPeriod: defaultResyncPeriod,
|
||||
}
|
||||
k8s.opts = opts
|
||||
@@ -249,10 +250,22 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
|
||||
return nil, c.ArgErr()
|
||||
}
|
||||
k8s.opts.initEndpointsCache = false
|
||||
case "ignore":
|
||||
args := c.RemainingArgs()
|
||||
if len(args) > 0 {
|
||||
ignore := args[0]
|
||||
if ignore == "empty_service" {
|
||||
k8s.opts.ignoreEmptyService = true
|
||||
continue
|
||||
} else {
|
||||
return nil, fmt.Errorf("unable to parse ignore value: '%v'", ignore)
|
||||
}
|
||||
}
|
||||
default:
|
||||
return nil, c.Errf("unknown property '%s'", c.Val())
|
||||
}
|
||||
}
|
||||
|
||||
return k8s, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user