Simplify sandbox pod match
@safiya2610 is already working on this.
Since Jun 28, 2026.
Assessment
This issue has not been assessed yet.
Description
After
https://github.com/kubernetes-sigs/agent-sandbox/pull/272 merged, each sanbox will have an annotation pointed to the pod.
So we donot need to do label selector matching, not this depend on agent-sandbox v0.3.10
// GetSandboxPodIP gets the IP address of the pod corresponding to the Sandbox
func (c *K8sClient) GetSandboxPodIP(_ context.Context, namespace, sandboxName, podName string) (string, error) {
// If podName is provided, try to get it directly from cache first
if podName != "" {
pod, err := c.podLister.Pods(namespace).Get(podName)
if err == nil && pod != nil {
return validateAndGetPodIP(pod)
}
klog.Infof("failed to get sandbox pod %s/%s: %v, try get pod by sandbox-name label", namespace, podName, err)
}
// Find pod through label selector (sandbox-name label we set)
pods, err := c.podLister.Pods(namespace).List(labels.SelectorFromSet(map[string]string{SandboxNameLabelKey: sandboxName}))
if err != nil {
return "", fmt.Errorf("failed to list pods from cache: %w", err)
}
// Find the pod that belongs to this sandbox by checking ownerReferences
for _, pod := range pods {
for _, ownerRef := range pod.OwnerReferences {
if ownerRef.Kind == "Sandbox" && ownerRef.Name == sandboxName {
if ownerRef.Controller == nil || *ownerRef.Controller {
return validateAndGetPodIP(pod)
}
}
}
}
return "", fmt.Errorf("no pod found for sandbox %s", sandboxName)
}```
- Dominant language
- Go
- Stars
- 167
- Forks
- 88
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from volcano-sh/agentcube
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
volcano-sh/agentcube#348 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
volcano-sh/agentcube#464 ·
-
kind/bug
volcano-sh/agentcube#454 · 2 comments · 1 assignee ·
-
kind/bug
volcano-sh/agentcube#449 · 1 comment · 1 assignee ·
-
kind/enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
volcano-sh/agentcube#444 · 3 comments ·
All issues in volcano-sh/agentcube
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100