Skip to content

Commit

Permalink
Fix context.TODO() in the example
Browse files Browse the repository at this point in the history
Signed-off-by: rashmigottipati <chowdary.grashmi@gmail.com>
  • Loading branch information
rashmigottipati committed Jan 21, 2021
1 parent 73c52e8 commit 4ac2c8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/builtins/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (r *reconcileReplicaSet) Reconcile(ctx context.Context, request reconcile.R

// Fetch the ReplicaSet from the cache
rs := &appsv1.ReplicaSet{}
err := r.client.Get(context.TODO(), request.NamespacedName, rs)
err := r.client.Get(ctx, request.NamespacedName, rs)
if errors.IsNotFound(err) {
log.Error(nil, "Could not find ReplicaSet")
return reconcile.Result{}, nil
Expand All @@ -65,7 +65,7 @@ func (r *reconcileReplicaSet) Reconcile(ctx context.Context, request reconcile.R

// Update the ReplicaSet
rs.Labels["hello"] = "world"
err = r.client.Update(context.TODO(), rs)
err = r.client.Update(ctx, rs)
if err != nil {
return reconcile.Result{}, fmt.Errorf("could not write ReplicaSet: %+v", err)
}
Expand Down

0 comments on commit 4ac2c8e

Please sign in to comment.