Skip to content

Commit 1882cf2

Browse files
committed
Make sure to log error in findObjectsForSrc()
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]>
1 parent c5389f5 commit 1882cf2

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

controllers/designateapi_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ func (r *DesignateAPIReconciler) findObjectsForSrc(ctx context.Context, src clie
367367
}
368368
err := r.Client.List(context.TODO(), crList, listOps)
369369
if err != nil {
370-
return []reconcile.Request{}
370+
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
371+
return requests
371372
}
372373

373374
for _, item := range crList.Items {

controllers/designatecentral_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ func (r *DesignateCentralReconciler) findObjectsForSrc(ctx context.Context, src
322322
}
323323
err := r.Client.List(context.TODO(), crList, listOps)
324324
if err != nil {
325-
return []reconcile.Request{}
325+
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
326+
return requests
326327
}
327328

328329
for _, item := range crList.Items {

controllers/designatemdns_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ func (r *DesignateMdnsReconciler) findObjectsForSrc(ctx context.Context, src cli
321321
}
322322
err := r.Client.List(context.TODO(), crList, listOps)
323323
if err != nil {
324-
return []reconcile.Request{}
324+
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
325+
return requests
325326
}
326327

327328
for _, item := range crList.Items {

controllers/designateproducer_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ func (r *DesignateProducerReconciler) findObjectsForSrc(ctx context.Context, src
321321
}
322322
err := r.Client.List(context.TODO(), crList, listOps)
323323
if err != nil {
324-
return []reconcile.Request{}
324+
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
325+
return requests
325326
}
326327

327328
for _, item := range crList.Items {

controllers/designateworker_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ func (r *DesignateWorkerReconciler) findObjectsForSrc(ctx context.Context, src c
321321
}
322322
err := r.Client.List(context.TODO(), crList, listOps)
323323
if err != nil {
324-
return []reconcile.Request{}
324+
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
325+
return requests
325326
}
326327

327328
for _, item := range crList.Items {

0 commit comments

Comments
 (0)