mirror of
https://github.com/coredns/coredns.git
synced 2025-10-31 18:23:13 -04:00
add client labels to k8s plugin metadata (#6475)
Signed-off-by: Nolan Miles <nolanpmiles@gmail.com>
This commit is contained in:
@@ -19,6 +19,13 @@ func (k *Kubernetes) Metadata(ctx context.Context, state request.Request) contex
|
||||
metadata.SetValueFunc(ctx, "kubernetes/client-pod-name", func() string {
|
||||
return pod.Name
|
||||
})
|
||||
|
||||
for k, v := range pod.Labels {
|
||||
v := v
|
||||
metadata.SetValueFunc(ctx, "kubernetes/client-label/"+k, func() string {
|
||||
return v
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
zone := plugin.Zones(k.Zones).Matches(state.Name())
|
||||
|
||||
Reference in New Issue
Block a user