You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.Printf("[ipam-pool-monitor] Increasing pool size, Current Pool Size: %v, Requested IP Count: %v, Pods with IP's:%v", len(pm.cns.GetPodIPConfigState()), pm.cachedNNC.Spec.RequestedIPCount, len(pm.cns.GetAllocatedIPConfigs()))
115
+
logger.Printf("[ipam-pool-monitor] Increasing pool size, Current Pool Size: %v, Requested IP Count: %v, Pods with IP's:%v, ToBeDeleted Count: %v", len(pm.cns.GetPodIPConfigState()), pm.cachedNNC.Spec.RequestedIPCount, len(pm.cns.GetAllocatedIPConfigs()), len(pm.cachedNNC.Spec.IPsNotInUse))
logger.Printf("[ipam-pool-monitor] Decreasing pool size, Current Pool Size: %v, Requested IP Count: %v, Pods with IP's: %v", len(pm.cns.GetPodIPConfigState()), pm.cachedNNC.Spec.RequestedIPCount, len(pm.cns.GetAllocatedIPConfigs()))
140
+
logger.Printf("[ipam-pool-monitor] Decreasing pool size, Current Pool Size: %v, Requested IP Count: %v, Pods with IP's: %v, ToBeDeleted Count: %v", len(pm.cns.GetPodIPConfigState()), pm.cachedNNC.Spec.RequestedIPCount, len(pm.cns.GetAllocatedIPConfigs()), len(pm.cachedNNC.Spec.IPsNotInUse))
t.Fatalf("Expected IP's not in use to be 0 after reconcile, expected %v, actual %v", (initialIPConfigCount-batchSize), len(poolmonitor.cachedNNC.Spec.IPsNotInUse))
t.Fatalf("Expected pool size to be one batch size smaller after reconcile, expected %v, actual %v", (initialIPConfigCount-batchSize), len(poolmonitor.cachedNNC.Spec.IPsNotInUse))
363
+
}
364
+
365
+
// Reconcile again, it should release the second batch
366
+
t.Logf("Reconcile again - 2, Exepected free count = 20")
367
+
err=poolmonitor.Reconcile()
368
+
iferr!=nil {
369
+
t.Errorf("Expected pool monitor to not fail after CNS set number of allocated IP's %v", err)
370
+
}
371
+
372
+
// Ensure the size of the requested spec is still the same
t.Fatalf("Expected pool size to be one batch size smaller after reconcile, expected %v, actual %v", (initialIPConfigCount-batchSize), len(poolmonitor.cachedNNC.Spec.IPsNotInUse))
380
+
}
381
+
382
+
t.Logf("Update Request Controller")
383
+
err=fakerc.Reconcile()
384
+
iferr!=nil {
385
+
t.Error(err)
386
+
}
387
+
388
+
err=poolmonitor.Reconcile()
389
+
iferr!=nil {
390
+
t.Errorf("Expected no pool monitor failure after request controller reconcile: %v", err)
391
+
}
392
+
393
+
// Ensure the spec doesn't have any IPsNotInUse after request controller has reconciled
t.Fatalf("Expected IP's not in use to be 0 after reconcile, expected %v, actual %v", (initialIPConfigCount-batchSize), len(poolmonitor.cachedNNC.Spec.IPsNotInUse))
0 commit comments