Skip to content

Commit

Permalink
Ensure deletion of old finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
grdryn committed Aug 1, 2020
1 parent 6554ce9 commit 06a55d7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/controller/pagerdutyintegration/clusterdeployment_deleted.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ func (r *ReconcilePagerDutyIntegration) handleDelete(pdclient pd.Client, pdi *pa
return err
}
}

if utils.HasFinalizer(cd, config.OperatorFinalizer) {
r.reqLogger.Info("Deleting old PD finalizer from ClusterDeployment", "Namespace", cd.Namespace, "Name", cd.Name)
utils.DeleteFinalizer(cd, config.OperatorFinalizer)
err = r.client.Update(context.TODO(), cd)
if err != nil {
metrics.UpdateMetricPagerDutyDeleteFailure(1, ClusterID, pdi.Name)
return err
}
}

metrics.UpdateMetricPagerDutyDeleteFailure(0, ClusterID, pdi.Name)

return nil
Expand Down

0 comments on commit 06a55d7

Please sign in to comment.