Skip to content

Commit

Permalink
Merge pull request #192 from k8s-proxmox/fix/scheduler-log
Browse files Browse the repository at this point in the history
do not override logger with WithValues() as it creates many duplicate…
  • Loading branch information
sp-yduck authored Feb 1, 2025
2 parents e1aea0b + 469028b commit f815dd8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloud/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ func (s *Scheduler) WaitStatus(ctx context.Context, config *api.VirtualMachineCr

// create new qemu with given spec and context
func (s *Scheduler) CreateQEMU(ctx context.Context, config *api.VirtualMachineCreateOptions) (framework.SchedulerResult, error) {
s.logger = s.logger.WithValues("qemu", config.Name)
s.logger.Info("adding qemu to scheduler queue")
log := s.logger.WithValues("qemu", config.Name)
log.Info("adding qemu to scheduler queue")
// add qemu spec into the queue
s.schedulingQueue.Add(ctx, config)

Expand All @@ -262,10 +262,10 @@ func (s *Scheduler) CreateQEMU(ctx context.Context, config *api.VirtualMachineCr
return status.Result(), err
}
if status.Error() != nil {
s.logger.Error(status.Error(), fmt.Sprintf("failed to create qemu: %v", status.Messages()))
log.Error(status.Error(), fmt.Sprintf("failed to create qemu: %v", status.Messages()))
return status.Result(), status.Error()
}
s.logger.Info(fmt.Sprintf("%v", status.Messages()))
log.Info(fmt.Sprintf("%v", status.Messages()))
return status.Result(), nil
}

Expand Down

0 comments on commit f815dd8

Please sign in to comment.