@@ -62,26 +62,26 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
62
62
return ctrl.Result {}, nil
63
63
}
64
64
log .Error (nil , "unable to fetch Pod" )
65
- return ctrl.Result {}, nil
65
+ return ctrl.Result {}, err
66
66
}
67
67
68
68
annotation , err := r .NamespaceOrPodHaveAnnotation (pod , ctx )
69
69
if err != nil {
70
70
log .Error (nil , "failed to get annotations" )
71
- return ctrl.Result {}, nil
71
+ return ctrl.Result {}, err
72
72
}
73
73
ignoreAnnotation , err := r .NamespaceOrPodHaveIgnoreAnnotation (pod , ctx )
74
74
if err != nil {
75
75
log .Error (nil , "failed to get annotations" )
76
- return ctrl.Result {}, nil
76
+ return ctrl.Result {}, err
77
77
}
78
78
79
79
if ((! r .EnableAnnotation ) || (r .EnableAnnotation && annotation )) && ! ignoreAnnotation {
80
80
data , err := r .ClientSet .RESTClient ().Get ().AbsPath (fmt .Sprintf ("apis/metrics.k8s.io/v1beta1/namespaces/%v/pods/%v" , pod .Namespace , pod .Name )).DoRaw (ctx )
81
81
82
82
if err != nil {
83
83
log .Error (nil , "failed to get stats from pod" )
84
- return ctrl.Result {}, nil
84
+ return ctrl.Result {}, err
85
85
}
86
86
PodUsageData := GeneratePodRequestsObjectFromRestData (data )
87
87
err , _ , _ , deploymentName := r .GetPodParentKind (pod , ctx )
@@ -213,7 +213,7 @@ func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
213
213
214
214
err , podSpec , deployment , _ := r .GetPodParentKind (pod , ctx )
215
215
if err != nil {
216
- return ctrl.Result {}, nil
216
+ return ctrl.Result {}, err
217
217
}
218
218
219
219
UpdatePodController (podSpec , Requests , ctx )
0 commit comments