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 <[email protected]>
  • Loading branch information
stuggi committed Oct 10, 2024
1 parent 29b4baf commit 73b0690
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/neutronapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ func (r *NeutronAPIReconciler) findObjectsForSrc(ctx context.Context, src client
}
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 73b0690

Please sign in to comment.