Skip to content

Commit

Permalink
remove not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kanolato committed Aug 9, 2020
1 parent 029026f commit 27d1a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/book/src/cronjob-tutorial/testdata/finalizer_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (r *CronJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
// registering our finalizer.
if !containsString(cronJob.GetFinalizers(), myFinalizerName) {
cronJob.SetFinalizers(append(cronJob.GetFinalizers(), myFinalizerName))
if err := r.Update(context.Background(), &cronJob); err != nil {
if err := r.Update(context.Background(), cronJob); err != nil {
return ctrl.Result{}, err
}
}
Expand All @@ -76,7 +76,7 @@ func (r *CronJobReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {

// remove our finalizer from the list and update it.
cronJob.SetFinalizers(removeString(cronJob.GetFinalizers(), myFinalizerName))
if err := r.Update(context.Background(), &cronJob); err != nil {
if err := r.Update(context.Background(), cronJob); err != nil {
return ctrl.Result{}, err
}
}
Expand Down

0 comments on commit 27d1a68

Please sign in to comment.