Skip to content

Commit

Permalink
Merge pull request #2960 from sj14/fix-nil-pointer
Browse files Browse the repository at this point in the history
📖 Fix nil pointer in Finalizer example
  • Loading branch information
k8s-ci-robot committed Sep 22, 2022
2 parents 3bfc84e + 3b1ccc2 commit 75f1a28
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 75f1a28

Please sign in to comment.