otterize / network-mapper

Map Kubernetes traffic: in-cluster, to the Internet, and to AWS IAM and export as text, intents, or an image
Apache License 2.0
612 stars 23 forks source link

Fix bug where network sniffer would write a log indicating success reporting to mapper alongside log indicating failure #167

Closed orishoshan closed 10 months ago

orishoshan commented 10 months ago

Description

Previously, the network sniffer would not return once it logged an error for reporting to the mapper. This has no adverse effect, but the log that was produced was confusing, as it would log both an error and success:

{"error":"Post \"http://otterize-network-mapper:9090/query\": dial tcp 10.96.2.146:9090: i/o timeout","level":"error","msg":"Failed to report capture results","time":"2023-12-10T23:52:25Z"}                       │
{"level":"info","msg":"Reported captured requests of 1 clients to Mapper","time":"2023-12-10T23:52:25Z"}  

This PR fixes that.