Skip to content

Commit 6ef0fa6

Browse files
committed
Delete pod collection immediately
1 parent ae7dce7 commit 6ef0fa6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/e2e/common/pods.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,8 @@ var _ = framework.KubeDescribe("Pods", func() {
835835
ginkgo.It("should delete a collection of pods", func() {
836836
podTestNames := []string{"test-pod-1", "test-pod-2", "test-pod-3"}
837837

838+
zero := int64(0)
839+
838840
ginkgo.By("Create set of pods")
839841
// create a set of pods in test namespace
840842
for _, podTestName := range podTestNames {
@@ -845,6 +847,7 @@ var _ = framework.KubeDescribe("Pods", func() {
845847
"type": "Testing"},
846848
},
847849
Spec: v1.PodSpec{
850+
TerminationGracePeriodSeconds: &zero,
848851
Containers: []v1.Container{{
849852
Image: imageutils.GetE2EImage(imageutils.Agnhost),
850853
Name: "token-test",
@@ -861,7 +864,7 @@ var _ = framework.KubeDescribe("Pods", func() {
861864
framework.ExpectNoError(err, "3 pods not found")
862865

863866
// delete Collection of pods with a label in the current namespace
864-
err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{
867+
err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &zero}, metav1.ListOptions{
865868
LabelSelector: "type=Testing"})
866869
framework.ExpectNoError(err, "failed to delete collection of pods")
867870

0 commit comments

Comments
 (0)