add client labels to k8s plugin metadata (#6475)

Signed-off-by: Nolan Miles <nolanpmiles@gmail.com>
This commit is contained in:
miles-to-go
2024-03-07 14:34:09 -05:00
committed by GitHub
parent 3d67ee907d
commit 92b7e658e3
5 changed files with 24 additions and 5 deletions

View File

@@ -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())