diff options
author | 2021-03-16 08:34:22 -0400 | |
---|---|---|
committer | 2021-03-16 13:34:22 +0100 | |
commit | 32cc745dc215b1474d211a219327ae3701fd6f28 (patch) | |
tree | 0d1233349ba370f7db54b29bb69784957c39e7e9 /plugin | |
parent | a2b34a233d4f4931cf3d7d26f40475c23f770d7d (diff) | |
download | coredns-32cc745dc215b1474d211a219327ae3701fd6f28.tar.gz coredns-32cc745dc215b1474d211a219327ae3701fd6f28.tar.zst coredns-32cc745dc215b1474d211a219327ae3701fd6f28.zip |
add forward/upstream metadata (#4521)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/forward/forward.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/forward/forward.go b/plugin/forward/forward.go index 5f7d343de..624d08967 100644 --- a/plugin/forward/forward.go +++ b/plugin/forward/forward.go @@ -14,6 +14,7 @@ import ( "github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin/debug" "github.com/coredns/coredns/plugin/dnstap" + "github.com/coredns/coredns/plugin/metadata" clog "github.com/coredns/coredns/plugin/pkg/log" "github.com/coredns/coredns/request" @@ -122,6 +123,10 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg ctx = ot.ContextWithSpan(ctx, child) } + metadata.SetValueFunc(ctx, "forward/upstream", func() string { + return proxy.addr + }) + var ( ret *dns.Msg err error |