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
Cleanup TopologyManager and update policy.Merge() #87758
Cleanup TopologyManager and update policy.Merge() #87758
Conversation
fedea90
to
31fcce5
Compare
/assign @nolancon |
/lgtm |
/retest |
delete(m.podMap, containerID) | ||
klog.Infof("[topologymanager] RemoveContainer - Container ID: %v podTopologyHints: %v", containerID, m.podTopologyHints) | ||
delete(m.podTopologyHints[podUIDString], containerID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old implementation allowed RemoveContainer
to be called even when the m.podTopologyHints[podUIDString]
didn't exist. Should we check here for existence before delete?
Yes. We should always check for that. That was an oversight on my part. |
/hold |
31fcce5
to
f7f3b89
Compare
/hold cancel |
Previously, we unconditionally removed *all* topology hints from a pod whenever just one container was being removed. This commit makes it so we only remove the hints for the single container being removed, and then conditionally remove the pod from the podTopologyHints[podUID] when no containers left in it.
Previously, the verious Merge() policies of the TopologyManager all eturned their own lifecycle.PodAdmitResult result. However, for consistency in any failed admits, this is better handled in the top-level Topology manager, with each policy only returning a boolean about whether or not they would like to admit the pod or not. This commit changes the semantics to match this logic.
Previously, this function was taking full Pod and Container objects unnecessarily. This commit updates this so that they will take pointers instead.
f7f3b89
to
d5addb4
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: klueska The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/test pull-kubernetes-e2e-kind-ipv6 |
/test pull-kubernetes-e2e-gce |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR cleans up the logic in the TopologyManager pod Admit hander. As part of this, it simplifies the interface for its underlying policy.Merge() calls.
It is best reviewed commit-by-commit.
Does this PR introduce a user-facing change?: