diff --git a/test/e2e/kube-ovn/ipam/ipam.go b/test/e2e/kube-ovn/ipam/ipam.go index 2fbc12e480b..8cec8f996fa 100644 --- a/test/e2e/kube-ovn/ipam/ipam.go +++ b/test/e2e/kube-ovn/ipam/ipam.go @@ -193,6 +193,11 @@ var _ = framework.Describe("[group:ipam]", func() { ns := framework.MakeNamespace(newNamespaceName, nil, nsAnnotations) nsClient.Create(ns) + ginkgo.By("Creating subnet " + subnetName) + cidr = framework.RandomCIDR(f.ClusterIPFamily) + newSubnet := framework.MakeSubnet(subnetName, "", cidr, "", "", "", nil, nil, []string{newNamespaceName}) + newSubnet = subnetClient.CreateSync(subnet) + ginkgo.By("Creating deployment " + deployName + " without IPPool") labels := map[string]string{"app": deployName} deploy := framework.MakeDeployment(deployName, int32(replicas), labels, nil, "pause", framework.PauseImage, "") @@ -207,11 +212,11 @@ var _ = framework.Describe("[group:ipam]", func() { ips := strings.Split(ippool, ippoolSep) for _, pod := range pods.Items { framework.ExpectHaveKeyWithValue(pod.Annotations, util.AllocatedAnnotation, "true") - framework.ExpectHaveKeyWithValue(pod.Annotations, util.CidrAnnotation, subnet.Spec.CIDRBlock) - framework.ExpectHaveKeyWithValue(pod.Annotations, util.GatewayAnnotation, subnet.Spec.Gateway) + framework.ExpectHaveKeyWithValue(pod.Annotations, util.CidrAnnotation, newSubnet.Spec.CIDRBlock) + framework.ExpectHaveKeyWithValue(pod.Annotations, util.GatewayAnnotation, newSubnet.Spec.Gateway) framework.ExpectHaveKeyWithValue(pod.Annotations, util.IPPoolAnnotation, ippool) framework.ExpectContainElement(ips, pod.Annotations[util.IPAddressAnnotation]) - framework.ExpectHaveKeyWithValue(pod.Annotations, util.LogicalSwitchAnnotation, subnet.Name) + framework.ExpectHaveKeyWithValue(pod.Annotations, util.LogicalSwitchAnnotation, newSubnet.Name) framework.ExpectMAC(pod.Annotations[util.MacAddressAnnotation]) framework.ExpectHaveKeyWithValue(pod.Annotations, util.RoutedAnnotation, "true")