-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MAIN-2678] Fixing missing slack sink workload #1705
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
left a small comment
@@ -42,7 +42,7 @@ def handle_notification_grouping(self, finding: Finding, platform_enabled: bool) | |||
investigate_uri = self.get_timeline_uri(self.account_id, self.cluster_name) | |||
finding_data = finding.attribute_map | |||
# The top level entity name (the owner of the pod etc) | |||
finding_data["workload"] = finding.service.name if finding.service else None | |||
finding_data["workload"] = finding.service.name if finding.service else finding.backup_workload_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing it only for Slack?
it's probably useful on other places as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i saw that workload
only exists for slack, we can do this for the robusta sink if you think too
@@ -67,6 +67,19 @@ def guess_cached_resource(cls, name: str, namespace: str) -> Optional[TopLevelRe | |||
return cached_resource | |||
return None | |||
|
|||
@classmethod | |||
def guess_workload_from_labels(cls, labels: Dict[Any, Any] = None) -> Optional[TopLevelResource]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be part of the guess_cached_resource
method
I would just add this logic, in case the existing logic didn't work.
This way, it will also be available to all other places using the returned value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on it
if the workload does not exist, like the pod or deployment is deleted it falls back to using the prometheus labels for sinc matching