Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Avi-Robusta
Copy link
Contributor

if the workload does not exist, like the pod or deployment is deleted it falls back to using the prometheus labels for sinc matching

Copy link
Contributor

@arikalon1 arikalon1 left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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]:
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants