Skip to content

Commit

Permalink
rebase to main
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <[email protected]>
  • Loading branch information
fjogeleit committed Sep 1, 2024
1 parent 007a9ca commit 6a7c3a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/target/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,8 @@ func (f *TargetFactory) mapSecretValues(config any, ref, mountedSecret string) {
case *target.Config[target.SlackOptions]:
if values.Webhook != "" {
c.Config.Webhook = values.Webhook
}
if values.Channel != "" {
c.Config.Channel = values.Channel
}

Expand Down
8 changes: 8 additions & 0 deletions pkg/target/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func (s *client) message(result v1alpha2.PolicyReportResult) *slack.WebhookMessa
Channel: s.channel,
}

if s.channel != "" {
p.Channel = s.channel
}

att := slack.Attachment{
Color: colors[result.Priority],
Blocks: slack.Blocks{
Expand Down Expand Up @@ -178,6 +182,10 @@ func (s *client) batchMessage(polr v1alpha2.ReportInterface, results []v1alpha2.
Channel: s.channel,
}

if s.channel != "" {
p.Channel = s.channel
}

att := slack.Attachment{
Color: colors[v1alpha2.InfoPriority],
Blocks: slack.Blocks{
Expand Down

0 comments on commit 6a7c3a2

Please sign in to comment.