Skip to content

Commit

Permalink
Merge pull request #275 from stuggi/improve_index
Browse files Browse the repository at this point in the history
Make sure to log error in findObjectsForSrc()
  • Loading branch information
openshift-merge-bot[bot] authored Oct 10, 2024
2 parents 200b937 + f874cff commit ab6bb1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/galera_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,8 @@ func GetDatabaseObject(ctx context.Context, clientObj client.Client, name string
func (r *GaleraReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
requests := []reconcile.Request{}

l := log.FromContext(context.Background()).WithName("Controllers").WithName("Galera")

for _, field := range allWatchFields {
crList := &mariadbv1.GaleraList{}
listOps := &client.ListOptions{
Expand All @@ -993,10 +995,13 @@ func (r *GaleraReconciler) findObjectsForSrc(ctx context.Context, src client.Obj
}
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 {
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))

requests = append(requests,
reconcile.Request{
NamespacedName: types.NamespacedName{
Expand Down

0 comments on commit ab6bb1c

Please sign in to comment.