feat(slack): add slack notification for created backups

This commit is contained in:
Yukine 2021-02-04 04:13:22 +01:00
parent ac327d5677
commit 398b6bf0c1
No known key found for this signature in database
GPG Key ID: 6AE0B5764F0126D1
1 changed files with 7 additions and 0 deletions

View File

@ -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) {