Make e2e scale updates unconditional

This commit is contained in:
Jordan Liggitt 2019-12-16 15:46:35 -05:00
parent 3dc521ac04
commit 2164157113
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)