func (t *StatefulSetUpgradeTest) Setup(f *framework.Framework) {
	ssName := "ss"
	labels := map[string]string{
		"foo": "bar",
		"baz": "blah",
	}
	headlessSvcName := "test"
	statefulPodMounts := []v1.VolumeMount{{Name: "datadir", MountPath: "/data/"}}
	podMounts := []v1.VolumeMount{{Name: "home", MountPath: "/home"}}
	ns := f.Namespace.Name
	t.set = e2estatefulset.NewStatefulSet(ssName, ns, headlessSvcName, 2, statefulPodMounts, podMounts, labels)
	t.service = createStatefulSetService(ssName, labels)
	*(t.set.Spec.Replicas) = 3
	e2estatefulset.PauseNewPods(t.set)

	ginkgo.By("Creating service " + headlessSvcName + " in namespace " + ns)
	_, err := f.ClientSet.CoreV1().Services(ns).Create(context.TODO(), t.service, metav1.CreateOptions{})
	framework.ExpectNoError(err)

	ginkgo.By("Creating statefulset " + ssName + " in namespace " + ns)
	*(t.set.Spec.Replicas) = 3
	_, err = f.ClientSet.AppsV1().StatefulSets(ns).Create(context.TODO(), t.set, metav1.CreateOptions{})
	framework.ExpectNoError(err)

	ginkgo.By("Saturating stateful set " + t.set.Name)
	e2estatefulset.Saturate(f.ClientSet, t.set)
	t.verify(f)
	t.restart(f)
	t.verify(f)
}
// Setup creates a StatefulSet and a HeadlessService. It verifies the basic SatefulSet properties
Setup creates a StatefulSet and a HeadlessService. It verifies the basic SatefulSet properties
// Setup creates a StatefulSet and a HeadlessService . It verifies the basic SatefulSet properties
func (t *StatefulSetUpgradeTest) Setup(f *framework.Framework) {
	ssName := "ss"
	labels := map[string]string{
		"foo": "bar",
		"baz": "blah",
	}
	headlessSvcName := "test"
	statefulPodMounts := []v1.VolumeMount{{Name: "datadir", MountPath: "/data/"}}
	podMounts := []v1.VolumeMount{{Name: "home", MountPath: "/home"}}
	ns := f.Namespace.Name
	t.set = e2estatefulset.NewStatefulSet(ssName, ns, headlessSvcName, 2, statefulPodMounts, podMounts, labels)
	t.service = createStatefulSetService(ssName, labels)
	*(t.set.Spec.Replicas) = 3
	e2estatefulset.PauseNewPods(t.set)
	ginkgo.By("Creating service " + headlessSvcName + " in namespace " + ns)
	_, err := f.ClientSet.CoreV1().Services(ns).Create(context.TODO(), t.service, metav1.CreateOptions{})
	framework.ExpectNoError(err)
	ginkgo.By("Creating statefulset " + ssName + " in namespace " + ns)
	*(t.set.Spec.Replicas) = 3
	_, err = f.ClientSet.AppsV1().StatefulSets(ns).Create(context.TODO(), t.set, metav1.CreateOptions{})
	framework.ExpectNoError(err)
	ginkgo.By("Saturating stateful set " + t.set.Name)
	e2estatefulset.Saturate(f.ClientSet, t.set)
	t.verify(f)
	t.restart(f)
	t.verify(f)
}
func ( t * StatefulSetUpgradeTest ) Setup ( f * framework . Framework ) { ssName := " " labels := map [ string ] string { " " : " " , " " : " " , } headlessSvcName := " " statefulPodMounts := [ ] v1 . VolumeMount { { Name : " " , MountPath : " " } } podMounts := [ ] v1 . VolumeMount { { Name : " " , MountPath : " " } } ns := f . Namespace . Name t . set = e2estatefulset . NewStatefulSet ( ssName , ns , headlessSvcName , 2 , statefulPodMounts , podMounts , labels ) t . service = createStatefulSetService ( ssName , labels ) * ( t . set . Spec . Replicas ) = 3 e2estatefulset . PauseNewPods ( t . set ) ginkgo . By ( " " + headlessSvcName + " " + ns ) _ , err := f . ClientSet . CoreV1 ( ) . Services ( ns ) . Create ( context . TODO ( ) , t . service , metav1 . CreateOptions { } ) framework . ExpectNoError ( err ) ginkgo . By ( " " + ssName + " " + ns ) * ( t . set . Spec . Replicas ) = 3 _ , err = f . ClientSet . AppsV1 ( ) . StatefulSets ( ns ) . Create ( context . TODO ( ) , t . set , metav1 . CreateOptions { } ) framework . ExpectNoError ( err ) ginkgo . By ( " " + t . set . Name ) e2estatefulset . Saturate ( f . ClientSet , t . set ) t . verify ( f ) t . restart ( f ) t . verify ( f ) }
Setup creates a StatefulSet and a HeadlessService.
Setup creates a StatefulSet and a HeadlessService .