From 398b6bf0c108d7cc80bd15cea03c7e6538fd0ce7 Mon Sep 17 00:00:00 2001 From: Yukine Date: Thu, 4 Feb 2021 04:13:22 +0100 Subject: [PATCH] feat(slack): add slack notification for created backups --- cmd/DigitalOceanSnapshotter/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/DigitalOceanSnapshotter/main.go b/cmd/DigitalOceanSnapshotter/main.go index 7ef5e71..8efffe8 100644 --- a/cmd/DigitalOceanSnapshotter/main.go +++ b/cmd/DigitalOceanSnapshotter/main.go @@ -136,6 +136,13 @@ func main() { } } } + + if ctx.SlackContext != nil { + err = ctx.SlackContext.SendEvent(fmt.Sprintf("Successfully created Backup for Volumes %s", strings.Join(volumeIDs, ", ")), log.InfoLevel) + if err != nil { + handleError(ctx, err, false) + } + } } func handleError(ctx snapshotterContext, err error, fatal bool) {