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 1f0a2f5 commit 2ad3e4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/swiftproxy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ func (r *SwiftProxyReconciler) 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 2ad3e4b

Please sign in to comment.