Skip to content

Commit

Permalink
Fix clearing instance metrics when namespace is deleted (#1024)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Aug 29, 2024
1 parent bdf452d commit e312c82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/tempo/tempomonolithic_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func (r *TempoMonolithicReconciler) Reconcile(ctx context.Context, req ctrl.Requ
log.Error(err, "unable to fetch TempoMonolithic")
return ctrl.Result{}, fmt.Errorf("could not fetch tempo: %w", err)
}
// instance is not found, metrics can be cleared
status.ClearMonolithicMetrics(req.Namespace, req.Name)

// we'll ignore not-found errors, since they can't be fixed by an immediate
// requeue (we'll need to wait for a new notification), and we can get them
Expand Down
2 changes: 2 additions & 0 deletions controllers/tempo/tempostack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func (r *TempoStackReconciler) Reconcile(ctx context.Context, req ctrl.Request)
log.Error(err, "unable to fetch TempoStack")
return ctrl.Result{}, fmt.Errorf("could not fetch tempo: %w", err)
}
// instance is not found, metrics can be cleared
status.ClearTempoStackMetrics(req.Namespace, req.Name)

// we'll ignore not-found errors, since they can't be fixed by an immediate
// requeue (we'll need to wait for a new notification), and we can get them
Expand Down

0 comments on commit e312c82

Please sign in to comment.