RamenDR / ramen

Apache License 2.0
72 stars 52 forks source link

append condition to set metrics #1365

Closed rakeshgm closed 3 months ago

rakeshgm commented 3 months ago

Metrics were being set during delete of DRPC. The current check looks if drpc is deleted or not and here the check fails because at that moment drpc might not have deleted because of the ownership references. DRPC might be waiting for the child resources to be deleted. And in one of these instances we find drpc and sets metric with 0 value. Adding a check if finalizers is present ensures that metrics would be set only if finalizer is set. So in the delete scenario drpc would not have finalizers and this check would ensure that we do not set metrics again

fixes: 2264435

rakeshgm commented 3 months ago

Please add some notes on what issue this causes if not handled with the added finalizer check.

updated the PR and commit msg