Skip to content

Commit d6100ce

Browse files
authored
Fix bug where external ingress traffic detection would fail if more than one pod was found with the IP in cluster when determining if traffic is external (#214)
1 parent 349b542 commit d6100ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mapper/pkg/resolvers/helpers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func podLabelsToOtterizeLabels(pod *corev1.Pod) []model.PodLabel {
2424
// isExternalOrAssumeExternalIfError returns true if the IP is external or if an error occurred while determining if the IP is external.
2525
func (r *Resolver) isExternalOrAssumeExternalIfError(ctx context.Context, srcIP string) (bool, error) {
2626
_, err := r.kubeFinder.ResolveIPToPod(ctx, srcIP)
27+
if errors.Is(err, kubefinder.ErrFoundMoreThanOnePod) {
28+
return false, nil
29+
}
30+
2731
// If the IP is not found, it may be external
2832
if err != nil && !errors.Is(err, kubefinder.ErrNoPodFound) {
2933
return false, errors.Wrap(err)

0 commit comments

Comments
 (0)