Skip to content

Commit c701a42

Browse files
authored
fix: use target namespace to get pod info from repo (#3914)
1 parent 6aab160 commit c701a42

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/backend/endpoint_resolver.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ func (r *defaultEndpointResolver) resolvePodEndpointsWithEndpointsData(ctx conte
160160
}
161161
epAddr := ep.Addresses[0]
162162

163-
podKey := types.NamespacedName{Namespace: svcKey.Namespace, Name: ep.TargetRef.Name}
163+
podNamespace := svcKey.Namespace
164+
if ep.TargetRef.Namespace != "" {
165+
podNamespace = ep.TargetRef.Namespace
166+
}
167+
podKey := types.NamespacedName{Namespace: podNamespace, Name: ep.TargetRef.Name}
164168
pod, exists, err := r.podInfoRepo.Get(ctx, podKey)
165169
if err != nil {
166170
return nil, false, err

0 commit comments

Comments
 (0)