mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Cleanup logging and creation logic of TopologyManager in prep for beta
This commit is contained in:
parent
bc686ea27b
commit
d5addb4090
@ -124,7 +124,7 @@ func NewManager(numaNodeInfo cputopology.NUMANodeInfo, topologyPolicyName string
|
|||||||
numaNodes = append(numaNodes, node)
|
numaNodes = append(numaNodes, node)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(numaNodes) > maxAllowableNUMANodes {
|
if topologyPolicyName != PolicyNone && len(numaNodes) > maxAllowableNUMANodes {
|
||||||
return nil, fmt.Errorf("unsupported on machines with more than %v NUMA Nodes", maxAllowableNUMANodes)
|
return nil, fmt.Errorf("unsupported on machines with more than %v NUMA Nodes", maxAllowableNUMANodes)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,14 +209,12 @@ func (m *manager) RemoveContainer(containerID string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {
|
func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {
|
||||||
klog.Infof("[topologymanager] Topology Admit Handler")
|
// Unconditionally admit the pod if we are running with the 'none' policy.
|
||||||
if m.policy.Name() == "none" {
|
if m.policy.Name() == PolicyNone {
|
||||||
klog.Infof("[topologymanager] Skipping calculate topology affinity as policy: none")
|
return lifecycle.PodAdmitResult{Admit: true}
|
||||||
return lifecycle.PodAdmitResult{
|
|
||||||
Admit: true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
klog.Infof("[topologymanager] Topology Admit Handler")
|
||||||
pod := attrs.Pod
|
pod := attrs.Pod
|
||||||
hints := make(map[string]TopologyHint)
|
hints := make(map[string]TopologyHint)
|
||||||
|
|
||||||
@ -235,7 +233,5 @@ func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitR
|
|||||||
m.podTopologyHints[string(pod.UID)] = hints
|
m.podTopologyHints[string(pod.UID)] = hints
|
||||||
klog.Infof("[topologymanager] Topology Affinity for Pod: %v are %v", pod.UID, m.podTopologyHints[string(pod.UID)])
|
klog.Infof("[topologymanager] Topology Affinity for Pod: %v are %v", pod.UID, m.podTopologyHints[string(pod.UID)])
|
||||||
|
|
||||||
return lifecycle.PodAdmitResult{
|
return lifecycle.PodAdmitResult{Admit: true}
|
||||||
Admit: true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user