Skip to content

Commit

Permalink
Merge pull request #1355 from rashmigottipati/fix-example
Browse files Browse the repository at this point in the history
✨Fix context.TODO() in the example
  • Loading branch information
k8s-ci-robot committed Jan 21, 2021
2 parents e1dbc44 + 4ac2c8e commit 0133f4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/builtins/controller.go
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 0133f4f

Please sign in to comment.