From ccfb7faa1be961f76ab662a5f8c718571ce06ad0 Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Thu, 10 Oct 2024 22:21:47 +0000 Subject: [PATCH] tests: k8s-inotify.bats: don't leak configmap Delete the configmap if the test failed, not just on the successful path. Signed-off-by: Dan Mihai --- tests/integration/kubernetes/k8s-inotify.bats | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/kubernetes/k8s-inotify.bats b/tests/integration/kubernetes/k8s-inotify.bats index 361fb615ef..8acc3678ef 100644 --- a/tests/integration/kubernetes/k8s-inotify.bats +++ b/tests/integration/kubernetes/k8s-inotify.bats @@ -40,8 +40,6 @@ setup() { # Verify we saw the update result=$(kubectl get pod "$pod_name" --output="jsonpath={.status.containerStatuses[]}") echo $result | grep -vq Error - - kubectl delete configmap cm } teardown() { @@ -49,7 +47,10 @@ teardown() { [ "${KATA_HYPERVISOR}" == "fc" ] && skip "test not working see: ${fc_limitations}" issue_url="https://github.com/kata-containers/kata-containers/issues/8906" [ "${KATA_HYPERVISOR}" == "qemu-se" ] && skip "test not working for IBM Z LPAR (see ${issue_url})" + # Debugging information kubectl describe "pod/$pod_name" + kubectl delete pod "$pod_name" + kubectl delete configmap cm }