Skip to content

Commit e9e5752

Browse files
committed
Fix DRA race conditions.
1 parent e354e53 commit e9e5752

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controller/core/workload_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ func (r *WorkloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
275275
}
276276

277277
if workload.IsActive(&wl) && !workload.HasQuotaReservation(&wl) {
278-
if err := r.queues.AddOrUpdateWorkload(log, &wl, queueOptions...); err != nil {
278+
if err := r.queues.AddOrUpdateWorkload(log, wl.DeepCopy(), queueOptions...); err != nil {
279279
log.V(2).Info("Failed to add DRA workload to queue", "error", err)
280280
return ctrl.Result{}, err
281281
}
282282
} else {
283-
if !r.cache.AddOrUpdateWorkload(log, &wl) {
283+
if !r.cache.AddOrUpdateWorkload(log, wl.DeepCopy()) {
284284
log.V(2).Info("ClusterQueue for workload didn't exist; ignored for now")
285285
}
286286
}

0 commit comments

Comments
 (0)