File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -33,23 +33,16 @@ func GetPodFullName(pod *v1.Pod) string {
33
33
return pod .Name + "_" + pod .Namespace
34
34
}
35
35
36
- // GetPodStartTime returns start time of the given pod.
36
+ // GetPodStartTime returns start time of the given pod or current timestamp
37
+ // if it hasn't started yet.
37
38
func GetPodStartTime (pod * v1.Pod ) * metav1.Time {
38
39
if pod .Status .StartTime != nil {
39
40
return pod .Status .StartTime
40
41
}
41
- // Should not reach here as the start time of a running time should not be nil
42
- // Return current timestamp as the default value.
43
- // This will not affect the calculation of earliest timestamp of all the pods on one node,
44
- // because current timestamp is always after the StartTime of any pod in good state.
45
- klog .Errorf ("pod.Status.StartTime is nil for pod %s. Should not reach here." , pod .Name )
42
+ // Assumed pods and bound pods that haven't started don't have a StartTime yet.
46
43
return & metav1.Time {Time : time .Now ()}
47
44
}
48
45
49
- // lessFunc is a function that receives two items and returns true if the first
50
- // item should be placed before the second one when the list is sorted.
51
- type lessFunc = func (item1 , item2 interface {}) bool
52
-
53
46
// GetEarliestPodStartTime returns the earliest start time of all pods that
54
47
// have the highest priority among all victims.
55
48
func GetEarliestPodStartTime (victims * extenderv1.Victims ) * metav1.Time {
You can’t perform that action at this time.
0 commit comments