Skip to content

Commit

Permalink
Add log message for name of k8s cluster being synced (cartography-cnc…
Browse files Browse the repository at this point in the history
…f#737)

* Add log message for name of k8s cluster being synced

* Also log k8s cluster name along with exception
  • Loading branch information
ryan-lane authored Jan 7, 2022
1 parent 6aba7ab commit 685936b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cartography/intel/kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ def start_k8s_ingestion(session: Session, config: Config) -> None:
return

for client in get_k8s_clients(config.k8s_kubeconfig):
cluster = sync_namespaces(session, client, config.update_tag)
pods = sync_pods(session, client, config.update_tag, cluster)
sync_services(session, client, config.update_tag, cluster, pods)
logger.info(f"Syncing data for k8s cluster {client.name}...")
try:
cluster = sync_namespaces(session, client, config.update_tag)
pods = sync_pods(session, client, config.update_tag, cluster)
sync_services(session, client, config.update_tag, cluster, pods)
except Exception:
logger.exception(f"Failed to sync data for k8s cluster {client.name}...")
raise

run_cleanup_job(
"kubernetes_import_cleanup.json",
Expand Down

0 comments on commit 685936b

Please sign in to comment.