[e2e-node] Cleanup pods after the test runs

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2024-07-09 13:07:06 -04:00
parent bb089b9374
commit f6836df520
6 changed files with 11 additions and 4 deletions

View File

@@ -171,7 +171,7 @@ func getCurrentKubeletConfig(ctx context.Context) (*kubeletconfig.KubeletConfigu
return e2enodekubelet.GetCurrentKubeletConfig(ctx, framework.TestContext.NodeName, "", false, framework.TestContext.StandaloneMode)
}
func cleanupPods(f *framework.Framework) {
func addAfterEachForCleaningUpPods(f *framework.Framework) {
ginkgo.AfterEach(func(ctx context.Context) {
ginkgo.By("Deleting any Pods created by the test in namespace: " + f.Namespace.Name)
l, err := e2epod.NewPodClient(f).List(ctx, metav1.ListOptions{})