diff --git a/test/e2e/framework/service_util.go b/test/e2e/framework/service_util.go index 6a57107ab69..b9d5f8339db 100644 --- a/test/e2e/framework/service_util.go +++ b/test/e2e/framework/service_util.go @@ -844,15 +844,11 @@ func (t *ServiceTestFixture) Cleanup() []error { for rcName := range t.rcs { By("stopping RC " + rcName + " in namespace " + t.Namespace) // First, resize the RC to 0. - old, err := t.Client.Core().ReplicationControllers(t.Namespace).Get(rcName, metav1.GetOptions{}) + patch := `{"spec":{"replicas":0}}` + _, err := t.Client.Core().ReplicationControllers(t.Namespace).Patch(rcName, types.StrategicMergePatchType, []byte(patch)) if err != nil { errs = append(errs, err) } - x := int32(0) - old.Spec.Replicas = &x - if _, err := t.Client.Core().ReplicationControllers(t.Namespace).Update(old); err != nil { - errs = append(errs, err) - } // TODO(mikedanese): Wait. // Then, delete the RC altogether. if err := t.Client.Core().ReplicationControllers(t.Namespace).Delete(rcName, nil); err != nil {