Skip to content

Commit

Permalink
Make a copy of workload when admitting to avoid cache corruption
Browse files Browse the repository at this point in the history
Change-Id: Ie3c93f7764705d7f6bd843f5157ff45d7d990f50
  • Loading branch information
alculquicondor authored and ahg-g committed Aug 10, 2022
1 parent d410906 commit aae08e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (s *Scheduler) admit(ctx context.Context, e *entry) error {
log.V(2).Info("Workload assumed in the cache")

s.admissionRoutineWrapper.Run(func() {
err := s.client.Update(ctx, newWorkload)
err := s.client.Update(ctx, newWorkload.DeepCopy())
if err == nil {
s.recorder.Eventf(newWorkload, corev1.EventTypeNormal, "Admitted", "Admitted by ClusterQueue %v", admission.ClusterQueue)
log.V(2).Info("Workload successfully admitted and assigned flavors")
Expand Down

0 comments on commit aae08e5

Please sign in to comment.