@@ -126,9 +126,6 @@ type manager struct {
126
126
127
127
// allocatableMemory holds the allocatable memory for each NUMA node
128
128
allocatableMemory []state.Block
129
-
130
- // pendingAdmissionPod contain the pod during the admission phase
131
- pendingAdmissionPod * v1.Pod
132
129
}
133
130
134
131
var _ Manager = & manager {}
@@ -242,10 +239,6 @@ func (m *manager) GetMemoryNUMANodes(pod *v1.Pod, container *v1.Container) sets.
242
239
243
240
// Allocate is called to pre-allocate memory resources during Pod admission.
244
241
func (m * manager ) Allocate (pod * v1.Pod , container * v1.Container ) error {
245
- // The pod is during the admission phase. We need to save the pod to avoid it
246
- // being cleaned before the admission ended
247
- m .setPodPendingAdmission (pod )
248
-
249
242
// Garbage collect any stranded resources before allocation
250
243
m .removeStaleState ()
251
244
@@ -284,10 +277,6 @@ func (m *manager) State() state.Reader {
284
277
285
278
// GetPodTopologyHints returns the topology hints for the topology manager
286
279
func (m * manager ) GetPodTopologyHints (pod * v1.Pod ) map [string ][]topologymanager.TopologyHint {
287
- // The pod is during the admission phase. We need to save the pod to avoid it
288
- // being cleaned before the admission ended
289
- m .setPodPendingAdmission (pod )
290
-
291
280
// Garbage collect any stranded resources before providing TopologyHints
292
281
m .removeStaleState ()
293
282
// Delegate to active policy
@@ -296,10 +285,6 @@ func (m *manager) GetPodTopologyHints(pod *v1.Pod) map[string][]topologymanager.
296
285
297
286
// GetTopologyHints returns the topology hints for the topology manager
298
287
func (m * manager ) GetTopologyHints (pod * v1.Pod , container * v1.Container ) map [string ][]topologymanager.TopologyHint {
299
- // The pod is during the admission phase. We need to save the pod to avoid it
300
- // being cleaned before the admission ended
301
- m .setPodPendingAdmission (pod )
302
-
303
288
// Garbage collect any stranded resources before providing TopologyHints
304
289
m .removeStaleState ()
305
290
// Delegate to active policy
@@ -322,15 +307,12 @@ func (m *manager) removeStaleState() {
322
307
m .Lock ()
323
308
defer m .Unlock ()
324
309
325
- // Get the list of admitted and active pods.
326
- activeAndAdmittedPods := m .activePods ()
327
- if m .pendingAdmissionPod != nil {
328
- activeAndAdmittedPods = append (activeAndAdmittedPods , m .pendingAdmissionPod )
329
- }
310
+ // Get the list of active pods.
311
+ activePods := m .activePods ()
330
312
331
313
// Build a list of (podUID, containerName) pairs for all containers in all active Pods.
332
314
activeContainers := make (map [string ]map [string ]struct {})
333
- for _ , pod := range activeAndAdmittedPods {
315
+ for _ , pod := range activePods {
334
316
activeContainers [string (pod .UID )] = make (map [string ]struct {})
335
317
for _ , container := range append (pod .Spec .InitContainers , pod .Spec .Containers ... ) {
336
318
activeContainers [string (pod .UID )][container .Name ] = struct {}{}
@@ -464,10 +446,3 @@ func (m *manager) GetAllocatableMemory() []state.Block {
464
446
func (m * manager ) GetMemory (podUID , containerName string ) []state.Block {
465
447
return m .state .GetMemoryBlocks (podUID , containerName )
466
448
}
467
-
468
- func (m * manager ) setPodPendingAdmission (pod * v1.Pod ) {
469
- m .Lock ()
470
- defer m .Unlock ()
471
-
472
- m .pendingAdmissionPod = pod
473
- }
0 commit comments