Skip to content

Commit 54ab6ef

Browse files
authored
fix regression where slack channel IDs stopped working (#461)
Fixes issue: #460
1 parent dc45130 commit 54ab6ef

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

robusta_krr/core/runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,9 @@ def _process_result(self, result: Result) -> None:
157157
file_permalink = result["file"]["permalink"]
158158

159159
# Post message with file link to channel
160-
channel = settings.slack_output if settings.slack_output.startswith('#') else f"#{settings.slack_output}"
161160
slack_title = settings.slack_title if settings.slack_title else f'Kubernetes Resource Report for {(" ".join(settings.namespaces))}'
162161
client.chat_postMessage(
163-
channel=channel,
162+
channel=settings.slack_output,
164163
text=f'{slack_title}\n{file_permalink}'
165164
)
166165

robusta_krr/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def run_strategy(
263263
slack_output: Optional[str] = typer.Option(
264264
None,
265265
"--slackoutput",
266-
help="Send to output to a slack channel, must have SLACK_BOT_TOKEN with permissions: chat:write, files:write, chat:write.public. Bot must be added to the channel.",
266+
help="Send output to Slack. Values starting with # will be interpreted to be channel names but other values may refer to channel IDs. SLACK_BOT_TOKEN env variable must exist with permissions: chat:write, files:write, chat:write.public. Bot must be added to the channel.",
267267
rich_help_panel="Output Settings",
268268
),
269269
slack_title: Optional[str] = typer.Option(

0 commit comments

Comments
 (0)