Skip to content

Commit

Permalink
changed exception logs to debug logs in kubernetes_client nodes disco…
Browse files Browse the repository at this point in the history
…very (#470)
  • Loading branch information
danielsagi authored Jul 22, 2021
1 parent c96312b commit f67f082
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kube_hunter/modules/discovery/kubernetes_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ def list_all_k8s_cluster_nodes(kube_config=None, client=None):
logger = logging.getLogger(__name__)
try:
if kube_config:
logger.info("Attempting to use kubeconfig file: %s", kube_config)
logger.debug("Attempting to use kubeconfig file: %s", kube_config)
kubernetes.config.load_kube_config(config_file=kube_config)
else:
logger.info("Attempting to use in cluster Kubernetes config")
logger.debug("Attempting to use in cluster Kubernetes config")
kubernetes.config.load_incluster_config()
except kubernetes.config.config_exception.ConfigException as ex:
logger.exception(f"Failed to initiate Kubernetes client: {ex}")
logger.debug(f"Failed to initiate Kubernetes client: {ex}")
return

try:
Expand All @@ -24,4 +24,4 @@ def list_all_k8s_cluster_nodes(kube_config=None, client=None):
for addr in item.status.addresses:
yield addr.address
except Exception as ex:
logger.exception(f"Failed to list nodes from Kubernetes: {ex}")
logger.debug(f"Failed to list nodes from Kubernetes: {ex}")

0 comments on commit f67f082

Please sign in to comment.