diff --git a/test/e2e/kube-ovn/ipam/ipam.go b/test/e2e/kube-ovn/ipam/ipam.go index 753d2577b8e..21addd2dd7a 100644 --- a/test/e2e/kube-ovn/ipam/ipam.go +++ b/test/e2e/kube-ovn/ipam/ipam.go @@ -529,15 +529,14 @@ var _ = framework.Describe("[group:ipam]", func() { ippoolClient.CreateSync(ippool1) ippoolClient.CreateSync(ippool2) - ginkgo.By("Creating deployment " + testDeployName + " without IPPool annotation") + ginkgo.By("Creating statefulset " + testDeployName + " with logical switch annotation and no ippool annotation") labels := map[string]string{"app": testDeployName} - annotations := map[string]string{util.LogicalSwitchAnnotation: subnetName} - deploy := framework.MakeDeployment(testDeployName, int32(replicas), labels, annotations, "pause", framework.PauseImage, "") - deployClient.CreateSync(deploy) + sts := framework.MakeStatefulSet(testDeployName, testDeployName, int32(replicas), labels, framework.PauseImage) + sts.Spec.Template.Annotations = map[string]string{util.LogicalSwitchAnnotation: subnetName} + sts = stsClient.CreateSync(sts) - ginkgo.By("Getting pods for deployment " + testDeployName) - pods, err := deployClient.GetPods(deploy) - framework.ExpectNoError(err, "failed to get pods for deployment "+testDeployName) + ginkgo.By("Getting pods for statefulset " + testDeployName) + pods := stsClient.GetPods(sts) framework.ExpectHaveLen(pods.Items, replicas) for _, pod := range pods.Items {