@@ -41,8 +41,8 @@ func (r *CronJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
41
41
ctx := context .Background ()
42
42
log := r .Log .WithValues ("cronjob" , req .NamespacedName )
43
43
44
- var cronJob batch .CronJob
45
- if err := r .Get (ctx , req .NamespacedName , & cronJob ); err != nil {
44
+ var cronJob * batchv1 .CronJob
45
+ if err := r .Get (ctx , req .NamespacedName , cronJob ); err != nil {
46
46
log .Error (err , "unable to fetch CronJob" )
47
47
// we'll ignore not-found errors, since they can't be fixed by an immediate
48
48
// requeue (we'll need to wait for a new notification), and we can get them
@@ -81,10 +81,13 @@ func (r *CronJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
81
81
}
82
82
}
83
83
84
- return ctrl.Result {}, err
84
+ // Stop reconciliation as the item is being deleted
85
+ return ctrl.Result {}, nil
85
86
}
86
87
87
- // rest of the reconciler code
88
+ // Your reconcile logic
89
+
90
+ return ctrl.Result {}, nil
88
91
}
89
92
90
93
func (r * Reconciler ) deleteExternalResources (cronJob * batch.CronJob ) error {
0 commit comments