Skip to content

Commit f711408

Browse files
committed
🔊 add reconcile err logs
modified: controllers/pod_controller.go
1 parent e5e1616 commit f711408

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/pod_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,26 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
6262
return ctrl.Result{}, nil
6363
}
6464
log.Error(nil, "unable to fetch Pod")
65-
return ctrl.Result{}, nil
65+
return ctrl.Result{}, err
6666
}
6767

6868
annotation, err := r.NamespaceOrPodHaveAnnotation(pod, ctx)
6969
if err != nil {
7070
log.Error(nil, "failed to get annotations")
71-
return ctrl.Result{}, nil
71+
return ctrl.Result{}, err
7272
}
7373
ignoreAnnotation, err := r.NamespaceOrPodHaveIgnoreAnnotation(pod, ctx)
7474
if err != nil {
7575
log.Error(nil, "failed to get annotations")
76-
return ctrl.Result{}, nil
76+
return ctrl.Result{}, err
7777
}
7878

7979
if ((!r.EnableAnnotation) || (r.EnableAnnotation && annotation)) && !ignoreAnnotation {
8080
data, err := r.ClientSet.RESTClient().Get().AbsPath(fmt.Sprintf("apis/metrics.k8s.io/v1beta1/namespaces/%v/pods/%v", pod.Namespace, pod.Name)).DoRaw(ctx)
8181

8282
if err != nil {
8383
log.Error(nil, "failed to get stats from pod")
84-
return ctrl.Result{}, nil
84+
return ctrl.Result{}, err
8585
}
8686
PodUsageData := GeneratePodRequestsObjectFromRestData(data)
8787
err, _, _, deploymentName := r.GetPodParentKind(pod, ctx)
@@ -213,7 +213,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
213213

214214
err, podSpec, deployment, _ := r.GetPodParentKind(pod, ctx)
215215
if err != nil {
216-
return ctrl.Result{}, nil
216+
return ctrl.Result{}, err
217217
}
218218

219219
UpdatePodController(podSpec, Requests, ctx)

0 commit comments

Comments
 (0)