From 1b0f981f82ce7ba9fe906d29332aa78f2a0d842d Mon Sep 17 00:00:00 2001 From: Andrzej Wasylkowski Date: Thu, 1 Jun 2017 13:12:27 +0200 Subject: [PATCH] Made the GetReplicas function count only ready replicas. Counting all replicas makes functions dependent on GetReplicas proceed with trying to use replicas that are not ready yet. --- test/e2e/common/autoscaling_utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/common/autoscaling_utils.go b/test/e2e/common/autoscaling_utils.go index a2abe0a3906..aa16ef4e207 100644 --- a/test/e2e/common/autoscaling_utils.go +++ b/test/e2e/common/autoscaling_utils.go @@ -321,21 +321,21 @@ func (rc *ResourceConsumer) GetReplicas() int { if replicationController == nil { framework.Failf(rcIsNil) } - return int(replicationController.Status.Replicas) + return int(replicationController.Status.ReadyReplicas) case KindDeployment: deployment, err := rc.framework.ClientSet.Extensions().Deployments(rc.framework.Namespace.Name).Get(rc.name, metav1.GetOptions{}) framework.ExpectNoError(err) if deployment == nil { framework.Failf(deploymentIsNil) } - return int(deployment.Status.Replicas) + return int(deployment.Status.ReadyReplicas) case KindReplicaSet: rs, err := rc.framework.ClientSet.Extensions().ReplicaSets(rc.framework.Namespace.Name).Get(rc.name, metav1.GetOptions{}) framework.ExpectNoError(err) if rs == nil { framework.Failf(rsIsNil) } - return int(rs.Status.Replicas) + return int(rs.Status.ReadyReplicas) default: framework.Failf(invalidKind) }