Increase TerminationGracePeriodSeconds to 1

This commit is contained in:
Stephen Heywood
2021-05-12 11:09:34 +12:00
parent c7be77935e
commit 4e3d006001
2 changed files with 11 additions and 11 deletions

View File

@@ -845,7 +845,7 @@ var _ = SIGDescribe("Pods", func() {
framework.ConformanceIt("should delete a collection of pods", func() {
podTestNames := []string{"test-pod-1", "test-pod-2", "test-pod-3"}
zero := int64(0)
one := int64(1)
ginkgo.By("Create set of pods")
// create a set of pods in test namespace
@@ -857,7 +857,7 @@ var _ = SIGDescribe("Pods", func() {
"type": "Testing"},
},
Spec: v1.PodSpec{
TerminationGracePeriodSeconds: &zero,
TerminationGracePeriodSeconds: &one,
Containers: []v1.Container{{
Image: imageutils.GetE2EImage(imageutils.Agnhost),
Name: "token-test",
@@ -874,7 +874,7 @@ var _ = SIGDescribe("Pods", func() {
framework.ExpectNoError(err, "3 pods not found")
// delete Collection of pods with a label in the current namespace
err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &zero}, metav1.ListOptions{
err = f.ClientSet.CoreV1().Pods(f.Namespace.Name).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &one}, metav1.ListOptions{
LabelSelector: "type=Testing"})
framework.ExpectNoError(err, "failed to delete collection of pods")
@@ -899,7 +899,7 @@ var _ = SIGDescribe("Pods", func() {
testPodImage2 := imageutils.GetE2EImage(imageutils.Httpd)
testPodLabels := map[string]string{"test-pod-static": "true"}
testPodLabelsFlat := "test-pod-static=true"
zero := int64(0)
one := int64(1)
w := &cache.ListWatch{
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
@@ -916,7 +916,7 @@ var _ = SIGDescribe("Pods", func() {
Labels: testPodLabels,
},
Spec: v1.PodSpec{
TerminationGracePeriodSeconds: &zero,
TerminationGracePeriodSeconds: &one,
Containers: []v1.Container{
{
Name: testPodName,
@@ -956,7 +956,7 @@ var _ = SIGDescribe("Pods", func() {
Labels: map[string]string{"test-pod": "patched"},
},
Spec: v1.PodSpec{
TerminationGracePeriodSeconds: &zero,
TerminationGracePeriodSeconds: &one,
Containers: []v1.Container{{
Name: testPodName,
Image: testPodImage2,
@@ -1023,7 +1023,7 @@ var _ = SIGDescribe("Pods", func() {
framework.ExpectEqual(podStatusFieldPatchCount, podStatusFieldPatchCountTotal, "failed to update PodStatus - field patch count doesn't match the total")
ginkgo.By("deleting the Pod via a Collection with a LabelSelector")
err = f.ClientSet.CoreV1().Pods(testNamespaceName).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &zero}, metav1.ListOptions{LabelSelector: testPodLabelsFlat})
err = f.ClientSet.CoreV1().Pods(testNamespaceName).DeleteCollection(context.TODO(), metav1.DeleteOptions{GracePeriodSeconds: &one}, metav1.ListOptions{LabelSelector: testPodLabelsFlat})
framework.ExpectNoError(err, "failed to delete Pod by collection")
ginkgo.By("watching for the Pod to be deleted")