From ac181959e51fa13c4711e8d3ed644b9ac8ad6681 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 21 Feb 2024 15:24:45 +0800 Subject: [PATCH] slacknotifier: handle slack.Attachment pointer --- pkg/notifier/slacknotifier/slack.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/notifier/slacknotifier/slack.go b/pkg/notifier/slacknotifier/slack.go index f1aee5840d..f2f5ff8db0 100644 --- a/pkg/notifier/slacknotifier/slack.go +++ b/pkg/notifier/slacknotifier/slack.go @@ -83,6 +83,13 @@ func filterSlackAttachments(args []interface{}) (slackAttachments []slack.Attach slackAttachments = append(slackAttachments, a) + case *slack.Attachment: + if firstAttachmentOffset == -1 { + firstAttachmentOffset = idx + } + + slackAttachments = append(slackAttachments, *a) + case types.SlackAttachmentCreator: if firstAttachmentOffset == -1 { firstAttachmentOffset = idx