Combine statefulset burst and monotonic scaling tests

Use subtests to avoid duplicating entire suite of control logic.
parent 2861ae5e
...@@ -640,7 +640,7 @@ func scaleUpStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetControl ...@@ -640,7 +640,7 @@ func scaleUpStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetControl
pod = getPodAtOrdinal(pods, ord) pod = getPodAtOrdinal(pods, ord)
ssc.updatePod(&prev, pod) ssc.updatePod(&prev, pod)
fakeWorker(ssc) fakeWorker(ssc)
if err := assertInvariants(set, spc); err != nil { if err := assertMonotonicInvariants(set, spc); err != nil {
return err return err
} }
if obj, _, err := spc.setsIndexer.Get(set); err != nil { if obj, _, err := spc.setsIndexer.Get(set); err != nil {
...@@ -650,7 +650,7 @@ func scaleUpStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetControl ...@@ -650,7 +650,7 @@ func scaleUpStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetControl
} }
} }
return assertInvariants(set, spc) return assertMonotonicInvariants(set, spc)
} }
func scaleDownStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetController, spc *fakeStatefulPodControl) error { func scaleDownStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetController, spc *fakeStatefulPodControl) error {
...@@ -692,5 +692,5 @@ func scaleDownStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetContr ...@@ -692,5 +692,5 @@ func scaleDownStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetContr
set = obj.(*apps.StatefulSet) set = obj.(*apps.StatefulSet)
} }
} }
return assertInvariants(set, spc) return assertMonotonicInvariants(set, spc)
} }
...@@ -229,7 +229,7 @@ func isHealthy(pod *v1.Pod) bool { ...@@ -229,7 +229,7 @@ func isHealthy(pod *v1.Pod) bool {
// allowsBurst is true if the alpha burst annotation is set. // allowsBurst is true if the alpha burst annotation is set.
func allowsBurst(set *apps.StatefulSet) bool { func allowsBurst(set *apps.StatefulSet) bool {
return set.Annotations[apps.StatefulSetBurstAnnotation] == "true" return set.Spec.PodManagementPolicy == apps.ParallelPodManagement
} }
// newControllerRef returns an ControllerRef pointing to a given StatefulSet. // newControllerRef returns an ControllerRef pointing to a given StatefulSet.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment