Skip to content

Commit

Permalink
fix: use target namespace to get pod info from repo (#3914)
Browse files Browse the repository at this point in the history
  • Loading branch information
Revolution1 authored Nov 20, 2024
1 parent 6aab160 commit c701a42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/backend/endpoint_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ func (r *defaultEndpointResolver) resolvePodEndpointsWithEndpointsData(ctx conte
}
epAddr := ep.Addresses[0]

podKey := types.NamespacedName{Namespace: svcKey.Namespace, Name: ep.TargetRef.Name}
podNamespace := svcKey.Namespace
if ep.TargetRef.Namespace != "" {
podNamespace = ep.TargetRef.Namespace
}
podKey := types.NamespacedName{Namespace: podNamespace, Name: ep.TargetRef.Name}
pod, exists, err := r.podInfoRepo.Get(ctx, podKey)
if err != nil {
return nil, false, err
Expand Down

0 comments on commit c701a42

Please sign in to comment.