Skip to content

Commit

Permalink
updated description
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-Robusta committed Jan 5, 2025
1 parent 40934f3 commit 609befb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion playbooks/robusta_playbooks/kubectl_enrichments.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
class KubectlParams(PodRunningParams):
"""
:var kubectl_command: The full kubectl command to run, formatted as a shell command string.
:var description: A description of the command ran.
:var timeout: The maximum time (in seconds) to wait for the kubectl command to complete. Default is 3600 seconds.
"""

command: str = None # type: ignore
description: str = None
timeout: int = 3600


Expand Down Expand Up @@ -62,11 +64,12 @@ def kubectl_command(event: ExecutionBaseEvent, params: KubectlParams):
delete_job_post_execution=True,
process_name=False,
)
descriptiont_text = params.description if params.description else "Kubectl Command"
event.add_enrichment(
[
MarkdownBlock(f"*{formatted_kubectl_command}*"),
FileBlock(f"kubectl.txt", kubectl_response.encode()),
], title="Kubectl Command"
], title=descriptiont_text
)
except Exception:
logging.exception("Error running kubectl command")
Expand Down

0 comments on commit 609befb

Please sign in to comment.