mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Merge pull request #8306 from lvlv/master
Fix a potential bug in TestControllerBurstReplicas
This commit is contained in:
commit
f57f317830
@ -889,9 +889,9 @@ func doTestControllerBurstReplicas(t *testing.T, burstReplicas, numReplicas int)
|
|||||||
|
|
||||||
// This simulates the watch events for all but 1 of the expected pods.
|
// This simulates the watch events for all but 1 of the expected pods.
|
||||||
// None of these should wake the controller because it has expectations==BurstReplicas.
|
// None of these should wake the controller because it has expectations==BurstReplicas.
|
||||||
for _, pod := range pods.Items[:expectedPods-1] {
|
for i := 0; i < expectedPods-1; i++ {
|
||||||
manager.podStore.Store.Add(&pod)
|
manager.podStore.Store.Add(&pods.Items[i])
|
||||||
manager.addPod(&pod)
|
manager.addPod(&pods.Items[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
podExp, exists, err := manager.expectations.GetExpectations(controllerSpec)
|
podExp, exists, err := manager.expectations.GetExpectations(controllerSpec)
|
||||||
@ -907,9 +907,9 @@ func doTestControllerBurstReplicas(t *testing.T, burstReplicas, numReplicas int)
|
|||||||
expectedPods = burstReplicas
|
expectedPods = burstReplicas
|
||||||
}
|
}
|
||||||
validateSyncReplication(t, &fakePodControl, 0, expectedPods)
|
validateSyncReplication(t, &fakePodControl, 0, expectedPods)
|
||||||
for _, pod := range pods.Items[:expectedPods-1] {
|
for i := 0; i < expectedPods-1; i++ {
|
||||||
manager.podStore.Store.Delete(&pod)
|
manager.podStore.Store.Delete(&pods.Items[i])
|
||||||
manager.deletePod(&pod)
|
manager.deletePod(&pods.Items[i])
|
||||||
}
|
}
|
||||||
podExp, exists, err := manager.expectations.GetExpectations(controllerSpec)
|
podExp, exists, err := manager.expectations.GetExpectations(controllerSpec)
|
||||||
if !exists || err != nil {
|
if !exists || err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user