Skip to content

Commit

Permalink
Fix nil pointer in Finalizer example
Browse files Browse the repository at this point in the history
  • Loading branch information
sj14 authored Sep 22, 2022
1 parent 3bfc84e commit 3b1ccc2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The code snippet below shows skeleton code for implementing a finalizer.
func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := r.Log.WithValues("cronjob", req.NamespacedName)

var cronJob *batchv1.CronJob
cronJob := &batchv1.CronJob{}
if err := r.Get(ctx, req.NamespacedName, cronJob); err != nil {
log.Error(err, "unable to fetch CronJob")
// we'll ignore not-found errors, since they can't be fixed by an immediate
Expand Down

0 comments on commit 3b1ccc2

Please sign in to comment.