@@ -84,7 +84,7 @@ func NewUpdatePriorityCalculator(vpa *vpa_types.VerticalPodAutoscaler,
84
84
func (calc * UpdatePriorityCalculator ) AddPod (pod * apiv1.Pod , now time.Time ) {
85
85
processedRecommendation , _ , err := calc .recommendationProcessor .Apply (calc .vpa .Status .Recommendation , calc .vpa .Spec .ResourcePolicy , calc .vpa .Status .Conditions , pod )
86
86
if err != nil {
87
- klog .V (2 ).Infof ("cannot process recommendation for pod %s/%s : %v" , pod . Namespace , pod . Name , err )
87
+ klog .V (2 ).Infof ("cannot process recommendation for pod %s: %v" , klog . KObj ( pod ) , err )
88
88
return
89
89
}
90
90
@@ -114,7 +114,7 @@ func (calc *UpdatePriorityCalculator) AddPod(pod *apiv1.Pod, now time.Time) {
114
114
terminationState .Terminated .Reason == "OOMKilled" &&
115
115
terminationState .Terminated .FinishedAt .Time .Sub (terminationState .Terminated .StartedAt .Time ) < * evictAfterOOMThreshold {
116
116
quickOOM = true
117
- klog .V (2 ).Infof ("quick OOM detected in pod %v/%v , container %v" , pod . Namespace , pod . Name , cs .Name )
117
+ klog .V (2 ).Infof ("quick OOM detected in pod %s , container %v" , klog . KObj ( pod ) , cs .Name )
118
118
}
119
119
}
120
120
@@ -125,25 +125,25 @@ func (calc *UpdatePriorityCalculator) AddPod(pod *apiv1.Pod, now time.Time) {
125
125
if ! updatePriority .OutsideRecommendedRange && ! quickOOM {
126
126
if pod .Status .StartTime == nil {
127
127
// TODO: Set proper condition on the VPA.
128
- klog .V (4 ).Infof ("not updating pod %v/%v , missing field pod.Status.StartTime" , pod . Namespace , pod . Name )
128
+ klog .V (4 ).Infof ("not updating pod %s , missing field pod.Status.StartTime" , klog . KObj ( pod ) )
129
129
return
130
130
}
131
131
if now .Before (pod .Status .StartTime .Add (* podLifetimeUpdateThreshold )) {
132
- klog .V (4 ).Infof ("not updating a short-lived pod %v/%v , request within recommended range" , pod . Namespace , pod . Name )
132
+ klog .V (4 ).Infof ("not updating a short-lived pod %s , request within recommended range" , klog . KObj ( pod ) )
133
133
return
134
134
}
135
135
if updatePriority .ResourceDiff < calc .config .MinChangePriority {
136
- klog .V (4 ).Infof ("not updating pod %v/%v , resource diff too low: %v" , pod . Namespace , pod . Name , updatePriority )
136
+ klog .V (4 ).Infof ("not updating pod %s , resource diff too low: %v" , klog . KObj ( pod ) , updatePriority )
137
137
return
138
138
}
139
139
}
140
140
141
141
// If the pod has quick OOMed then evict only if the resources will change
142
142
if quickOOM && updatePriority .ResourceDiff == 0 {
143
- klog .V (4 ).Infof ("not updating pod %v/%v because resource would not change" , pod . Namespace , pod . Name )
143
+ klog .V (4 ).Infof ("not updating pod %s because resource would not change" , klog . KObj ( pod ) )
144
144
return
145
145
}
146
- klog .V (2 ).Infof ("pod accepted for update %v/%v with priority %v - processed recommendations:\n %v" , pod . Namespace , pod . Name , updatePriority .ResourceDiff , calc .GetProcessedRecommendationTargets (processedRecommendation ))
146
+ klog .V (2 ).Infof ("pod accepted for update %s with priority %v - processed recommendations:\n %v" , klog . KObj ( pod ) , updatePriority .ResourceDiff , calc .GetProcessedRecommendationTargets (processedRecommendation ))
147
147
calc .pods = append (calc .pods , prioritizedPod {
148
148
pod : pod ,
149
149
priority : updatePriority ,
0 commit comments