Skip to content

Commit

Permalink
Make sure to log error in findObjectsForSrc()
Browse files Browse the repository at this point in the history
It is hidden right now if there is an error in configured named
fields and index. Lets log the error and return the current state
of requests.

With this the findObjectsForSrc() will exit with an hidden error
like:

```
"error": "Index with name field:.spec.ksmTls.caBundleSecretName does not exist"
```

Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
  • Loading branch information
stuggi authored and openshift-merge-bot[bot] committed Oct 10, 2024
1 parent 9a07132 commit 203ecfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/placementapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,8 @@ func (r *PlacementAPIReconciler) findObjectsForSrc(ctx context.Context, src clie
}
err := r.List(ctx, crList, listOps)
if err != nil {
return []reconcile.Request{}
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
return requests
}

for _, item := range crList.Items {
Expand Down

0 comments on commit 203ecfd

Please sign in to comment.