Deployment: Filter Pods by Deployment selector in addition to ControllerRef.

Deployment should ignore Pods that don't match the selector, even if
they have a ControllerRef pointing to one of the ReplicaSets it owns.
The ReplicaSet itself will orphan the Pod as soon as it syncs.
This commit is contained in:
Anthony Yeh
2017-03-03 16:10:27 -08:00
parent 37534b66df
commit d96c4847b6
3 changed files with 18 additions and 16 deletions

View File

@@ -515,9 +515,9 @@ func TestGetPodMapForReplicaSets(t *testing.T) {
defer close(stopCh)
informers.Start(stopCh)
podMap, err := c.getPodMapForReplicaSets(d.Namespace, f.rsLister)
podMap, err := c.getPodMapForDeployment(d, f.rsLister)
if err != nil {
t.Fatalf("getPodMapForReplicaSets() error: %v", err)
t.Fatalf("getPodMapForDeployment() error: %v", err)
}
podCount := 0
for _, podList := range podMap {