Skip to content

Commit ab6bb1c

Browse files
Merge pull request #275 from stuggi/improve_index
Make sure to log error in findObjectsForSrc()
2 parents 200b937 + f874cff commit ab6bb1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

controllers/galera_controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,8 @@ func GetDatabaseObject(ctx context.Context, clientObj client.Client, name string
985985
func (r *GaleraReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
986986
requests := []reconcile.Request{}
987987

988+
l := log.FromContext(context.Background()).WithName("Controllers").WithName("Galera")
989+
988990
for _, field := range allWatchFields {
989991
crList := &mariadbv1.GaleraList{}
990992
listOps := &client.ListOptions{
@@ -993,10 +995,13 @@ func (r *GaleraReconciler) findObjectsForSrc(ctx context.Context, src client.Obj
993995
}
994996
err := r.List(ctx, crList, listOps)
995997
if err != nil {
996-
return []reconcile.Request{}
998+
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
999+
return requests
9971000
}
9981001

9991002
for _, item := range crList.Items {
1003+
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
1004+
10001005
requests = append(requests,
10011006
reconcile.Request{
10021007
NamespacedName: types.NamespacedName{

0 commit comments

Comments
 (0)