Skip to content

Commit

Permalink
Merge pull request #123 from K-Phoen/alert-manager-reset
Browse files Browse the repository at this point in the history
Implement alertmanager config reset on manifest deletion
  • Loading branch information
K-Phoen authored Jan 25, 2022
2 parents 8297eac + 5ffc4f9 commit 35984de
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/pkg/grafana/alertmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ func NewAlertManager(logger logr.Logger, grabanaClient *grabana.Client, refReade
}

func (manager *AlertManager) Reset(ctx context.Context) error {
return nil
config := alertmanager.New(
alertmanager.ContactPoints(
alertmanager.ContactPoint("grafana-default-email", email.To([]string{"<[email protected]>"})),
),
alertmanager.DefaultContactPoint("grafana-default-email"),
)

return manager.grabanaClient.ConfigureAlertManager(ctx, config)
}

func (manager *AlertManager) Configure(ctx context.Context, manifest v1alpha1.AlertManager) error {
Expand Down

0 comments on commit 35984de

Please sign in to comment.