Skip to content

Commit

Permalink
fix e2e err
Browse files Browse the repository at this point in the history
  • Loading branch information
changluyi committed Jul 10, 2023
1 parent b8eae39 commit 4fb7f83
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions test/e2e/kube-ovn/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,21 @@ var _ = framework.Describe("[group:pod]", func() {
subnet := framework.MakeSubnet(vpcName, "", cidr, "", vpcName, "", nil, nil, []string{namespaceName})
_ = subnetClient.CreateSync(subnet)

ginkgo.By("Creating pod with HTTP liveness and readiness probe that port is accessible " + subnetName)

ginkgo.By("Creating pod with HTTP liveness and readiness probe that port is accessible " + podName)
pod := framework.MakePod(namespaceName, podName, nil, nil, framework.NginxImage, nil, nil)
pod.Spec.Containers[0].ReadinessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Port: intstr.FromInt(80),
},
},
InitialDelaySeconds: 15,
}
pod.Spec.Containers[0].LivenessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Port: intstr.FromInt(80),
},
},
InitialDelaySeconds: 10,
}

pod = podClient.CreateSync(pod)
Expand All @@ -152,23 +149,21 @@ var _ = framework.Describe("[group:pod]", func() {

podClient.DeleteSync(podName)

ginkgo.By("Creating pod with HTTP liveness and readiness probe that port is not accessible " + subnetName)
ginkgo.By("Creating pod with HTTP liveness and readiness probe that port is not accessible " + podName)
pod = framework.MakePod(namespaceName, podName, nil, nil, framework.NginxImage, nil, nil)
pod.Spec.Containers[0].ReadinessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(81),
},
},
InitialDelaySeconds: 15,
}
pod.Spec.Containers[0].LivenessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(81),
},
},
InitialDelaySeconds: 10,
}

_ = podClient.Create(pod)
Expand All @@ -179,47 +174,43 @@ var _ = framework.Describe("[group:pod]", func() {

podClient.DeleteSync(podName)

ginkgo.By("Creating pod with TCP probe liveness and readiness probe that port is accessible " + subnetName)
ginkgo.By("Creating pod with TCP probe liveness and readiness probe that port is accessible " + podName)
pod = framework.MakePod(namespaceName, podName, nil, nil, framework.NginxImage, nil, nil)
pod.Spec.Containers[0].ReadinessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(80),
},
},
InitialDelaySeconds: 15,
}
pod.Spec.Containers[0].LivenessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(80),
},
},
InitialDelaySeconds: 10,
}

pod = podClient.CreateSync(pod)
framework.ExpectEqual(pod.Status.ContainerStatuses[0].Ready, true)

podClient.DeleteSync(podName)

ginkgo.By("Creating pod with TCP probe liveness and readiness probe that port is not accessible " + subnetName)
ginkgo.By("Creating pod with TCP probe liveness and readiness probe that port is not accessible " + podName)
pod = framework.MakePod(namespaceName, podName, nil, nil, framework.NginxImage, nil, nil)
pod.Spec.Containers[0].ReadinessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(81),
},
},
InitialDelaySeconds: 15,
}
pod.Spec.Containers[0].LivenessProbe = &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromInt(81),
},
},
InitialDelaySeconds: 10,
}

_ = podClient.Create(pod)
Expand Down

0 comments on commit 4fb7f83

Please sign in to comment.