@@ -34,9 +34,10 @@ import (
34
34
35
35
var generation int64
36
36
37
- // PodInfo is a wrapper to a Pod with additional information for purposes such as tracking
38
- // the timestamp when it's added to the queue or recording per-pod metrics.
39
- type PodInfo struct {
37
+ // QueuedPodInfo is a Pod wrapper with additional information related to
38
+ // the pod's status in the scheduling queue, such as the timestamp when
39
+ // it's added to the queue.
40
+ type QueuedPodInfo struct {
40
41
Pod * v1.Pod
41
42
// The time pod added to the scheduling queue.
42
43
Timestamp time.Time
@@ -50,16 +51,23 @@ type PodInfo struct {
50
51
InitialAttemptTimestamp time.Time
51
52
}
52
53
53
- // DeepCopy returns a deep copy of the PodInfo object.
54
- func (podInfo * PodInfo ) DeepCopy () * PodInfo {
55
- return & PodInfo {
56
- Pod : podInfo .Pod .DeepCopy (),
57
- Timestamp : podInfo .Timestamp ,
58
- Attempts : podInfo .Attempts ,
59
- InitialAttemptTimestamp : podInfo .InitialAttemptTimestamp ,
54
+ // DeepCopy returns a deep copy of the QueuedPodInfo object.
55
+ func (pqi * QueuedPodInfo ) DeepCopy () * QueuedPodInfo {
56
+ return & QueuedPodInfo {
57
+ Pod : pqi .Pod .DeepCopy (),
58
+ Timestamp : pqi .Timestamp ,
59
+ Attempts : pqi .Attempts ,
60
+ InitialAttemptTimestamp : pqi .InitialAttemptTimestamp ,
60
61
}
61
62
}
62
63
64
+ // PodInfo is a wrapper to a Pod with additional pre-computed information to
65
+ // accelerate processing. This information is typically immutable (e.g., pre-processed
66
+ // inter-pod affinity selectors).
67
+ type PodInfo struct {
68
+ Pod * v1.Pod
69
+ }
70
+
63
71
// NewPodInfo return a new PodInfo
64
72
func NewPodInfo (pod * v1.Pod ) * PodInfo {
65
73
return & PodInfo {
@@ -359,7 +367,6 @@ func (n *NodeInfo) String() string {
359
367
360
368
// AddPod adds pod information to this NodeInfo.
361
369
func (n * NodeInfo ) AddPod (pod * v1.Pod ) {
362
- // TODO(#89528): AddPod should accept a PodInfo as an input argument.
363
370
podInfo := NewPodInfo (pod )
364
371
res , non0CPU , non0Mem := calculateResource (pod )
365
372
n .Requested .MilliCPU += res .MilliCPU
0 commit comments