plugin/template: support metadata (#2958)

* Enable use of metadata in templates

* Update README

* Don't stash away ctx, instead use a new func
This commit is contained in:
John Belamaric
2019-07-03 16:10:56 +01:00
committed by GitHub
parent 2faad5b397
commit 7cf73cc01d
4 changed files with 135 additions and 4 deletions

View File

@@ -48,6 +48,8 @@ Each resource record is a full-featured [Go template](https://golang.org/pkg/tex
* `.Group` a map of the named capture groups.
* `.Message` the complete incoming DNS message.
* `.Question` the matched question section.
* `.Meta` a function that takes a metadata name and returns the value, if the
metadata plugin is enabled. For example, `.Meta "kubernetes/client-namespace"`
The output of the template must be a [RFC 1035](https://tools.ietf.org/html/rfc1035) style resource record (commonly referred to as a "zone file").