Commit d12b3429 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #30676 from m1093782566/improve-pod-log-output-format

Automatic merge from submit-queue [Scheduler] Improve pod log output debuggability Address issue is #30675 The result of my expirments shows that both `glog.Infof("%v", pod)` and `glog.Infof("%+v", pod)` can't output useful information of a pod, it can only output `kind:"" apiVersion:""`. `%#v` can output the whole content of pod, but it seems too much! So, my opinion is output pod info use the format of `%v` to print`pod.Namespace/pod.Name` instead of the pod **object** in both [here](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/scheduler.go#L96) and [here](https://github.com/kubernetes/kubernetes/blob/master/plugin/pkg/scheduler/scheduler.go#L100). @wojtek-t
parents a9a81219 458f5bd7
...@@ -93,11 +93,11 @@ func (s *Scheduler) Run() { ...@@ -93,11 +93,11 @@ func (s *Scheduler) Run() {
func (s *Scheduler) scheduleOne() { func (s *Scheduler) scheduleOne() {
pod := s.config.NextPod() pod := s.config.NextPod()
glog.V(3).Infof("Attempting to schedule: %+v", pod) glog.V(3).Infof("Attempting to schedule pod: %v/%v", pod.Namespace, pod.Name)
start := time.Now() start := time.Now()
dest, err := s.config.Algorithm.Schedule(pod, s.config.NodeLister) dest, err := s.config.Algorithm.Schedule(pod, s.config.NodeLister)
if err != nil { if err != nil {
glog.V(1).Infof("Failed to schedule: %+v", pod) glog.V(1).Infof("Failed to schedule pod: %v/%v", pod.Namespace, pod.Name)
s.config.Error(pod, err) s.config.Error(pod, err)
s.config.Recorder.Eventf(pod, api.EventTypeWarning, "FailedScheduling", "%v", err) s.config.Recorder.Eventf(pod, api.EventTypeWarning, "FailedScheduling", "%v", err)
s.config.PodConditionUpdater.Update(pod, &api.PodCondition{ s.config.PodConditionUpdater.Update(pod, &api.PodCondition{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment