Skip to content

Commit

Permalink
CR fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arikalon1 committed Jul 7, 2021
1 parent 6ed04ef commit be3b138
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion playbooks/aa_base_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class PodParams (SlackParams):
pod_name: str = None
pod_namespace: str = None

class NamespacedKindParams(SlackParams):
class NamespacedKubernetesObjectParams(SlackParams):
name: str = None
namespace: str = None
6 changes: 5 additions & 1 deletion playbooks/active_playbooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ active_playbooks:
enrichers:
- name: "GraphEnricher"
- name: "AlertDefaults"
- name: "CPUThrottlingAnalysis"
- name: "CPUThrottlingAnalysis"
- alert_name: "KubernetesDeploymentReplicasMismatch"
enrichers:
- name: "DeploymentStatusEnricher"
- name: "AlertDefaults"
4 changes: 2 additions & 2 deletions playbooks/deployment_enrichments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from robusta.api import *
from aa_base_params import NamespacedKindParams
from aa_base_params import NamespacedKubernetesObjectParams

def deployment_status_enrichment(deployment: Deployment) -> List[BaseBlock]:
block_list: List[BaseBlock] = []
Expand All @@ -11,7 +11,7 @@ def deployment_status_enrichment(deployment: Deployment) -> List[BaseBlock]:

@on_manual_trigger
def show_deployment_status_enrichment(event: ManualTriggerEvent):
params = NamespacedKindParams(**event.data)
params = NamespacedKubernetesObjectParams(**event.data)
deployment: Deployment = Deployment.readNamespacedDeployment(params.name, params.namespace).obj
blocks = deployment_status_enrichment(deployment)
if blocks:
Expand Down

0 comments on commit be3b138

Please sign in to comment.