Skip to content

Commit

Permalink
Remove DeleteAllOf call for deployments in SD controller
Browse files Browse the repository at this point in the history
This call requires deletecollection RBAC permission and was put in
the original code but it's really no longer necessary since we now
clean everything up via a finalizer.

Signed-off-by: Tom Pantelis <[email protected]>
  • Loading branch information
tpantelis authored and skitt committed Jun 10, 2024
1 parent 39de14c commit 19bb655
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions controllers/servicediscovery/servicediscovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
// Request object not found, could have been deleted after reconcile request.
// Owned objects are automatically garbage collected. For additional cleanup logic use finalizers.
// Return and don't requeue
deployment := &appsv1.Deployment{}
opts := []controllerClient.DeleteAllOfOption{
controllerClient.InNamespace(request.NamespacedName.Namespace),
controllerClient.MatchingLabels{"app": names.ServiceDiscoveryComponent},
}
err := r.ScopedClient.DeleteAllOf(ctx, deployment, opts...)

return reconcile.Result{}, errors.Wrap(err, "error deleting resource")
return reconcile.Result{}, nil
}

if err != nil {
Expand Down

0 comments on commit 19bb655

Please sign in to comment.