allow ttl 0 (#2348)

This commit is contained in:
Chris O'Haver 2018-11-30 13:05:49 -05:00 committed by GitHub
parent 95c9e14dcf
commit 41c5cf4424
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -92,7 +92,7 @@ kubernetes [ZONES...] {
will resolve External Services against itself. **ADDRESS** can be an IP, an IP:port, or a path will resolve External Services against itself. **ADDRESS** can be an IP, an IP:port, or a path
to a file structured like resolv.conf. to a file structured like resolv.conf.
* `ttl` allows you to set a custom TTL for responses. The default (and minimum allowed) is * `ttl` allows you to set a custom TTL for responses. The default (and minimum allowed) is
5 seconds, while the maximum is capped at 3600 seconds. 0 seconds, while the maximum is capped at 3600 seconds. Setting TTL to 0 will prevent records from being cached.
* `noendpoints` will turn off the serving of endpoint records by disabling the watch on endpoints. * `noendpoints` will turn off the serving of endpoint records by disabling the watch on endpoints.
All endpoint queries and headless service queries will result in an NXDOMAIN. All endpoint queries and headless service queries will result in an NXDOMAIN.
* `transfer` enables zone transfers. It may be specified multiples times. `To` signals the direction * `transfer` enables zone transfers. It may be specified multiples times. `To` signals the direction

View file

@ -247,8 +247,8 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if t < 5 || t > 3600 { if t < 0 || t > 3600 {
return nil, c.Errf("ttl must be in range [5, 3600]: %d", t) return nil, c.Errf("ttl must be in range [0, 3600]: %d", t)
} }
k8s.ttl = uint32(t) k8s.ttl = uint32(t)
case "transfer": case "transfer":