Merge pull request #86321 from liggitt/unconditional-scale-update

Make e2e scale updates unconditional
This commit is contained in:
Kubernetes Prow Robot 2019-12-21 05:43:32 -08:00 committed by GitHub
commit a81bc56dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -787,6 +787,7 @@ var _ = SIGDescribe("StatefulSet", func() {
framework.ExpectEqual(scale.Status.Replicas, int32(1))
ginkgo.By("updating a scale subresource")
scale.ResourceVersion = "" // indicate the scale update should be unconditional
scale.Spec.Replicas = 2
scaleResult, err := c.AppsV1().StatefulSets(ns).UpdateScale(ssName, scale)
if err != nil {

View File

@ -680,6 +680,7 @@ func (j *TestJig) Scale(replicas int) error {
return fmt.Errorf("failed to get scale for RC %q: %v", rc, err)
}
scale.ResourceVersion = "" // indicate the scale update should be unconditional
scale.Spec.Replicas = int32(replicas)
_, err = j.Client.CoreV1().ReplicationControllers(j.Namespace).UpdateScale(rc, scale)
if err != nil {

View File

@ -350,6 +350,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
scale, err := f.ClientSet.AppsV1().Deployments(ns).GetScale(name, metav1.GetOptions{})
framework.ExpectNoError(err)
if scale.Spec.Replicas != int32(num) {
scale.ResourceVersion = "" // indicate the scale update should be unconditional
scale.Spec.Replicas = int32(num)
_, err = f.ClientSet.AppsV1().Deployments(ns).UpdateScale(name, scale)
framework.ExpectNoError(err)
@ -400,6 +401,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
ginkgo.By(fmt.Sprintf("Scale backend replicas to %d", replicas))
scale, err := f.ClientSet.AppsV1().Deployments(ns).GetScale(name, metav1.GetOptions{})
framework.ExpectNoError(err)
scale.ResourceVersion = "" // indicate the scale update should be unconditional
scale.Spec.Replicas = int32(replicas)
_, err = f.ClientSet.AppsV1().Deployments(ns).UpdateScale(name, scale)
framework.ExpectNoError(err)
@ -448,6 +450,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
scale, err := f.ClientSet.AppsV1().Deployments(ns).GetScale(name, metav1.GetOptions{})
framework.ExpectNoError(err)
if scale.Spec.Replicas != int32(num) {
scale.ResourceVersion = "" // indicate the scale update should be unconditional
scale.Spec.Replicas = int32(num)
_, err = f.ClientSet.AppsV1().Deployments(ns).UpdateScale(name, scale)
framework.ExpectNoError(err)