Skip to content

Commit 0133f4f

Browse files
authored
Merge pull request #1355 from rashmigottipati/fix-example
✨Fix context.TODO() in the example
2 parents e1dbc44 + 4ac2c8e commit 0133f4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/builtins/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (r *reconcileReplicaSet) Reconcile(ctx context.Context, request reconcile.R
4242

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

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

0 commit comments

Comments
 (0)