Improve mirror pod creation/deletion

- Ignore the "not found" error on deletion.
 - Recognize the "already exists" error on creation and check if the existing
   pod meets requirement. If so, don't report an error.
 - Immediately create a mirror pod after a successful deletion, if needed.
This commit is contained in:
Yu-Ju Hong
2016-01-21 11:55:37 -08:00
parent 233d292ae5
commit 25f2c6f330
3 changed files with 17 additions and 12 deletions

View File

@@ -3399,8 +3399,8 @@ func TestDeleteOutdatedMirrorPod(t *testing.T) {
}
name := kubecontainer.GetPodFullName(pod)
creates, deletes := manager.GetCounts(name)
if creates != 0 || deletes != 1 {
t.Errorf("expected 0 creation and 1 deletion of %q, got %d, %d", name, creates, deletes)
if creates != 1 || deletes != 1 {
t.Errorf("expected 1 creation and 1 deletion of %q, got %d, %d", name, creates, deletes)
}
}