diff --git a/internal/controller/predicates/alertmanager_secret_predicate.go b/internal/controller/predicates/alertmanager_secret_predicate.go index 210133f1..11c6e1ee 100644 --- a/internal/controller/predicates/alertmanager_secret_predicate.go +++ b/internal/controller/predicates/alertmanager_secret_predicate.go @@ -18,6 +18,10 @@ func NewAlertmanagerSecretPredicate(secretName, namespace string) predicate.Pred return false } + if !secret.DeletionTimestamp.IsZero() { + return false + } + labels := secret.GetLabels() ok = secret.GetName() == secretName && @@ -51,12 +55,17 @@ func NewAlertmanagerPodPredicate() predicate.Predicate { return false } + if !pod.DeletionTimestamp.IsZero() { + return false + } + labels := pod.GetLabels() ok = pod.GetNamespace() == mimirNamespace && labels != nil && labels["app.kubernetes.io/component"] == mimirAlertmanagerComponent && - labels["app.kubernetes.io/instance"] == mimirInstance + labels["app.kubernetes.io/instance"] == mimirInstance && + isPodReady(pod) return ok }