mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-03 06:43:53 +00:00
Listing pods only once when getting pods for RS in deployment
This commit is contained in:
@@ -96,7 +96,7 @@ func newPod(now time.Time, ready bool, beforeSec int) api.Pod {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetReadyPodsCount(t *testing.T) {
|
||||
func TestCountAvailablePods(t *testing.T) {
|
||||
now := time.Now()
|
||||
tests := []struct {
|
||||
pods []api.Pod
|
||||
@@ -124,7 +124,7 @@ func TestGetReadyPodsCount(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
if count := getReadyPodsCount(test.pods, int32(test.minReadySeconds)); int(count) != test.expected {
|
||||
if count := countAvailablePods(test.pods, int32(test.minReadySeconds)); int(count) != test.expected {
|
||||
t.Errorf("Pods = %#v, minReadySeconds = %d, expected %d, got %d", test.pods, test.minReadySeconds, test.expected, count)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user