From c88adb0a8b8fb742191c079f479a71909fc424aa Mon Sep 17 00:00:00 2001 From: arik Date: Mon, 12 Sep 2022 16:37:14 +0300 Subject: [PATCH] sink findings bug (#536) --- src/robusta/core/playbooks/playbooks_event_handler_impl.py | 3 +++ src/robusta/utils/auth_provider.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/robusta/core/playbooks/playbooks_event_handler_impl.py b/src/robusta/core/playbooks/playbooks_event_handler_impl.py index 1561ce74a..10f455237 100644 --- a/src/robusta/core/playbooks/playbooks_event_handler_impl.py +++ b/src/robusta/core/playbooks/playbooks_event_handler_impl.py @@ -41,6 +41,9 @@ def handle_trigger(self, trigger_event: TriggerEvent) -> Optional[Dict[str, Any] execution_event = fired_trigger.build_execution_event( trigger_event, sink_findings ) + # sink_findings needs to be shared between playbooks. + # build_execution_event returns a different instance because it's running in a child process + execution_event.sink_findings = sink_findings except Exception: logging.error(f"Failed to build execution event for {trigger_event.get_event_description()}") diff --git a/src/robusta/utils/auth_provider.py b/src/robusta/utils/auth_provider.py index 4f105dad1..4b3c7a341 100644 --- a/src/robusta/utils/auth_provider.py +++ b/src/robusta/utils/auth_provider.py @@ -31,7 +31,7 @@ def _load_private_key(file_name: str) -> Optional[RSAPrivateKey]: logging.info(f"Loaded private key file {file_name}") return private_key except Exception: - logging.error(f"Could not load private key file {file_name}") + logging.error(f"Could not load private key file {file_name}", exc_info=True) return None @@ -43,6 +43,6 @@ def _load_public_key(file_name: str) -> Optional[RSAPublicKey]: logging.info(f"Loaded public key file {file_name}") return public_key except Exception: - logging.error(f"Could not load public key file {file_name}") + logging.error(f"Could not load public key file {file_name}", exc_info=True) return None