@@ -382,7 +382,7 @@ func (r *Resolver) handleTrafficLevelReport(ctx context.Context, results model.T
382
382
logrus .
383
383
WithField ("ip" , report .SrcIP ).
384
384
WithError (err ).
385
- Error ( "Could not resolve source IP to identity" )
385
+ Debug ( "could not resolve source IP to identity" )
386
386
continue
387
387
}
388
388
@@ -392,7 +392,19 @@ func (r *Resolver) handleTrafficLevelReport(ctx context.Context, results model.T
392
392
logrus .
393
393
WithField ("ip" , report .DstIP ).
394
394
WithError (err ).
395
- Error ("Could not resolve destination IP to identity" )
395
+ Debug ("could not resolve destination IP to identity" )
396
+ continue
397
+ }
398
+
399
+ if sourceIdentity .Name == "" || destinationIdentity .Name == "" || sourceIdentity .Namespace == "" || destinationIdentity .Namespace == "" {
400
+ // catches a bug where the source or destination identity is not set, without any other errors
401
+ logrus .
402
+ WithContext (ctx ).
403
+ WithField ("sourceIP" , report .SrcIP ).
404
+ WithField ("destinationIP" , report .DstIP ).
405
+ WithField ("sourceIdentity" , sourceIdentity .String ()).
406
+ WithField ("destinationIdentity" , destinationIdentity .String ()).
407
+ Error ("invalid traffic level report" )
396
408
continue
397
409
}
398
410
@@ -885,38 +897,38 @@ func (r *Resolver) resolveIPToIdentity(ctx context.Context, ip string) (servicei
885
897
isPod , err := r .kubeFinder .IsPodIp (ctx , ip )
886
898
887
899
if err != nil {
888
- logrus .WithField ("ip" , ip ).WithError (err ).Error ("could not determine if IP is a pod" )
889
900
return serviceidentity.ServiceIdentity {}, errors .Wrap (err )
890
901
}
891
902
892
903
if isPod {
893
904
sourcePod , err := r .kubeFinder .ResolveIPToPod (ctx , ip )
894
905
895
906
if err != nil {
896
- logrus .WithField ("ip" , ip ).WithError (err ).Error ("could not resolve source pod" )
897
907
return serviceidentity.ServiceIdentity {}, errors .Wrap (err )
898
908
}
899
909
900
910
identity , err = r .serviceIdResolver .ResolvePodToServiceIdentity (ctx , sourcePod )
901
911
902
912
if err != nil {
903
- logrus .WithField ("ip" , ip ).WithError (err ).Error ("could not resolve source identity" )
904
913
return serviceidentity.ServiceIdentity {}, errors .Wrap (err )
905
914
}
906
915
} else {
907
916
sourceService , ok , err := r .kubeFinder .ResolveIPToService (ctx , ip )
908
-
909
- if ! ok || err != nil {
910
- logrus .WithField ("ip" , ip ).WithError (err ).Error ("could not resolve source service" )
917
+ if ! ok {
918
+ err = errors .New ("no mapping between IP and service" )
919
+ }
920
+ if err != nil {
911
921
return serviceidentity.ServiceIdentity {}, errors .Wrap (err )
912
922
}
913
923
914
924
otrSourceIdentity , ok , err := r .kubeFinder .ResolveOtterizeIdentityForService (ctx , sourceService , time .Now ())
915
-
916
- if ! ok || err != nil {
917
- logrus .WithField ("ip" , ip ).WithError (err ).Error ("could not resolve source identity" )
925
+ if ! ok {
926
+ err = errors .New ("no mapping between service and otterize identity" )
927
+ }
928
+ if err != nil {
918
929
return serviceidentity.ServiceIdentity {}, errors .Wrap (err )
919
930
}
931
+
920
932
identity = serviceidentity.ServiceIdentity {
921
933
Name : otrSourceIdentity .Name ,
922
934
Namespace : otrSourceIdentity .Namespace ,
0 commit comments