From 397b7e20380dd585c2e3ebb803e14250d0e7685f Mon Sep 17 00:00:00 2001 From: Jesus Carrillo Date: Wed, 10 Jul 2024 01:00:28 -0700 Subject: [PATCH] FIX: Propagate Slack channel Override (#459) This PR fixes a bug that prevents routing slack messages to the configured target channels. Related to: https://github.com/kyverno/policy-reporter/issues/458 Signed-off-by: Jesus Carrillo --- pkg/target/slack/slack.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/target/slack/slack.go b/pkg/target/slack/slack.go index 3480f79f..e69a907f 100644 --- a/pkg/target/slack/slack.go +++ b/pkg/target/slack/slack.go @@ -66,6 +66,10 @@ func (s *client) newPayload(result v1alpha2.PolicyReportResult) payload { Attachments: make([]attachment, 0, 1), } + if s.channel != "" { + p.Channel = s.channel + } + att := attachment{ Color: colors[result.Priority], Blocks: make([]block, 0),