Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topology Manager none policy bug fix #88876

Merged
merged 1 commit into from Mar 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 12 additions & 5 deletions pkg/kubelet/cm/topologymanager/topology_manager.go
Expand Up @@ -223,15 +223,22 @@ func (m *manager) RemoveContainer(containerID string) error {
}

func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {
// Unconditionally admit the pod if we are running with the 'none' policy.
if m.policy.Name() == PolicyNone {
return lifecycle.PodAdmitResult{Admit: true}
}

klog.Infof("[topologymanager] Topology Admit Handler")
pod := attrs.Pod

for _, container := range append(pod.Spec.InitContainers, pod.Spec.Containers...) {
if m.policy.Name() == PolicyNone {
err := m.allocateAlignedResources(pod, &container)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do I have to call allocate with none?

Is it cpu manager on but topology manager off?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, cpu manager static policy and topology manager none policy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for clarification , fix makes sense as a result

if err != nil {
return lifecycle.PodAdmitResult{
Message: fmt.Sprintf("Allocate failed due to %v, which is unexpected", err),
Reason: "UnexpectedAdmissionError",
Admit: false,
}
}
continue
}

result, admit := m.calculateAffinity(pod, &container)
if !admit {
return lifecycle.PodAdmitResult{
Expand Down