Skip to content

Commit

Permalink
Merge pull request kubernetes#74013 from s-ito-ts/statefulsets_scale
Browse files Browse the repository at this point in the history
Add e2e test for scale sub-resource of statefulsets
  • Loading branch information
k8s-ci-robot authored Feb 19, 2019
2 parents 7a5ea30 + b46cbc3 commit aaf479f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/e2e/apps/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ var _ = SIGDescribe("StatefulSet", func() {
return nil
}, framework.StatefulPodTimeout, 2*time.Second).Should(BeNil())
})
/* Comment it for now until scale sub-resource is finalized in ref:pull/53679 for scale-sub resource specific comment.

It("should have a working scale subresource", func() {
By("Creating statefulset " + ssName + " in namespace " + ns)
ss := framework.NewStatefulSet(ssName, ns, headlessSvcName, 1, nil, nil, labels)
Expand All @@ -795,20 +795,16 @@ var _ = SIGDescribe("StatefulSet", func() {
ss = sst.WaitForStatus(ss)

By("getting scale subresource")
scale := framework.NewStatefulSetScale(ss)
scaleResult := &appsv1beta2.Scale{}
err = c.AppsV1().RESTClient().Get().AbsPath("/apis/apps/v1").Namespace(ns).Resource("statefulsets").Name(ssName).SubResource("scale").Do().Into(scale)
scale, err := c.AppsV1().StatefulSets(ns).GetScale(ssName, metav1.GetOptions{})
if err != nil {
framework.Failf("Failed to get scale subresource: %v", err)
}
Expect(scale.Spec.Replicas).To(Equal(int32(1)))
Expect(scale.Status.Replicas).To(Equal(int32(1)))

By("updating a scale subresource")
scale.ResourceVersion = "" //unconditionally update to 2 replicas
scale.Spec.Replicas = 2
err = c.AppsV1().RESTClient().Put().AbsPath("/apis/apps/v1").Namespace(ns).Resource("statefulsets").Name(ssName).SubResource("scale").Body(scale).Do().Into(scaleResult)
scaleResult, err := c.AppsV1().StatefulSets(ns).UpdateScale(ssName, scale)
if err != nil {
framework.Failf("Failed to put scale subresource: %v", err)
}
Expand All @@ -821,7 +817,6 @@ var _ = SIGDescribe("StatefulSet", func() {
}
Expect(*(ss.Spec.Replicas)).To(Equal(int32(2)))
})
*/
})

framework.KubeDescribe("Deploy clustered applications [Feature:StatefulSet] [Slow]", func() {
Expand Down

0 comments on commit aaf479f

Please sign in to comment.