plugin/kubernetes: support pods with multiple IPs (#8635)

The Pod object stored only the primary pod IP (status.podIP), causing
PodIndex lookups to fail for IPv6 clients in dual-stack clusters. This
prevented the metadata plugin from populating client-pod-name and
client-namespace.

Replace the PodIP string field with a PodIPs []string slice populated
from status.podIPs, and update podIPIndexFunc to index all IPs.

Signed-off-by: Christian Norbert Menges <christian.norbert.menges@sap.com>
This commit is contained in:
Christian Menges
2026-10-15 10:12:29 +02:00
committed by GitHub
parent 25b51bcbd9
commit 2e2324715b
6 changed files with 32 additions and 18 deletions

View File

@@ -716,7 +716,7 @@ func (APIConnServeTest) PodIndex(ip string) []*object.Pod {
}
a := []*object.Pod{
{
Namespace: "podns", Name: "foo", PodIP: "10.240.0.1",
Namespace: "podns", Name: "foo", PodIPs: []string{"10.240.0.1"},
Labels: map[string]string{
"app.kubernetes.io/name": "foo",
"bar": "baz",