Skip to content

Commit

Permalink
alertmanager: Fix handleAlertmanagerUpdate version check (prometheus-…
Browse files Browse the repository at this point in the history
…operator#3943)

* alertmanager: Fix handleAlertmanagerUpdate version check

handleAlertmanagerUpdate has to check if the resource has actually been updated

* fmt

Co-authored-by: Julien Baudon <julien.baudon@mymoneybank.com>
  • Loading branch information
Jbaudon and Julien Baudon authored Mar 31, 2021
1 parent be0176b commit 4826c90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/alertmanager/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,10 @@ func (c *Operator) handleAlertmanagerDelete(obj interface{}) {
}

func (c *Operator) handleAlertmanagerUpdate(old, cur interface{}) {
if old.(*monitoringv1.Alertmanager).ResourceVersion == cur.(*monitoringv1.Alertmanager).ResourceVersion {
return
}

key, ok := c.keyFunc(cur)
if !ok {
return
Expand Down

0 comments on commit 4826c90

Please sign in to comment.