Adding error log in case of a timeout

Signed-off-by: Amit Schendel <amitschendel@gmail.com>
This commit is contained in:
Amit Schendel
2024-02-01 10:18:38 +02:00
parent 6c98c68d25
commit 39365f5a68
+2
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"time"
logger "github.com/kubescape/go-logger"
servicediscovery "github.com/kubescape/kubescape-network-scanner/cmd"
)
@@ -42,6 +43,7 @@ func isUnauthenticatedService(host string, port int, namespace string) bool {
case result := <-results:
return result
case <-time.After(Timeout):
logger.L().Error(fmt.Sprintf("Timeout while scanning service: %s", k8sService))
return false
}
}