Skip to content

Commit

Permalink
provider/pd: don't bail out when snoozing an incident that's already …
Browse files Browse the repository at this point in the history
…acknowledged
  • Loading branch information
adamdecaf committed Oct 24, 2024
1 parent a5985bc commit 06fa663
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/provider/pd/incidents.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ func (c *client) snoozeIncident(ctx context.Context, logger log.Logger, inc *pag
}
_, err := c.underlying.ManageIncidentsWithContext(ctx, c.pdConfig.From, update)
if err != nil {
return fmt.Errorf("incident acknowledged: %w", err)
// Ignore this error if the incident is already acknowledged
if !strings.Contains(strings.ToLower(err.Error()), "incident already acknowledged") {
return fmt.Errorf("incident acknowledged: %w", err)
}
}

// Snooze the incident
Expand Down

0 comments on commit 06fa663

Please sign in to comment.