Skip to content

Commit

Permalink
Add namespace to Task listing:
Browse files Browse the repository at this point in the history
This is needed so that Rufio deployed with
ClusterRole will look at the correct and
corresponding Tasks. All other client calls
appear to have namespacing properly set.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Oct 15, 2024
1 parent 6180ef3 commit a4bdbf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (r *JobReconciler) doReconcile(ctx context.Context, job *v1alpha1.Job, jobP

// List all Task owned by Job
tasks := &v1alpha1.TaskList{}
err = r.client.List(ctx, tasks, client.MatchingFields{jobOwnerKey: job.Name})
err = r.client.List(ctx, tasks, client.MatchingFields{jobOwnerKey: job.Name}, client.InNamespace(job.Namespace))
if err != nil {
return ctrl.Result{}, fmt.Errorf("failed to list owned Tasks for Job %s/%s: %w", job.Namespace, job.Name, err)
}
Expand Down

0 comments on commit a4bdbf5

Please sign in to comment.