remove pre/post affinity checks

This commit is contained in:
Aleksandra Malinowska 2020-02-11 16:47:41 +01:00
parent de631034c0
commit b71bbe135b
1 changed files with 1 additions and 9 deletions

View File

@ -246,8 +246,6 @@ func (data *internalDeltaSnapshotData) removePod(namespace, name, nodeName strin
data.clearCaches()
}
preAffinityPods := len(dni.PodsWithAffinity())
podFound := false
for _, pod := range dni.Pods() {
if pod.Namespace == namespace && pod.Name == name {
@ -263,13 +261,7 @@ func (data *internalDeltaSnapshotData) removePod(namespace, name, nodeName strin
}
// Maybe consider deleting from the list in the future. Maybe not.
postAffinityPods := len(dni.PodsWithAffinity())
if preAffinityPods == 1 && postAffinityPods == 0 {
data.havePodsWithAffinity = nil
}
if data.podList != nil {
data.clearPodCaches()
}
data.clearCaches()
return nil
}