From b812ec26df5c7519c400aeba0d23339c618a550b Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 13 Aug 2019 09:51:03 +0200 Subject: [PATCH] e2e: do not fail deleting resources when "resource not found" Sometimes the tests fail cleaning up due unavailable resources that are listed in the .yaml files. Deleting the missing resources returns "resource not found". By passing --ignore-not-found to kubectl, this problem should not happen anymore (and possibly makes it more obvious where tests do go wrong). --- e2e/e2e_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 6c398131c..628a28e41 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -56,22 +56,22 @@ func removeCephCSIResource() { // cleanup rbd cluster roles deployed by rook rbdPath := fmt.Sprintf("%s/%s/", rbdDirPath, "v1.13") - _, err = framework.RunKubectl("delete", "-f", rbdPath+rbdProvisionerRBAC) + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", rbdPath+rbdProvisionerRBAC) if err != nil { e2elog.Logf("failed to delete provisioner rbac %v", err) } - _, err = framework.RunKubectl("delete", "-f", rbdPath+rbdNodePluginRBAC) + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", rbdPath+rbdNodePluginRBAC) if err != nil { e2elog.Logf("failed to delete nodeplugin rbac %v", err) } // cleanup cephfs cluster roles deployed by rook cephfsPath := fmt.Sprintf("%s/%s/", cephfsDirPath, "v1.13") - _, err = framework.RunKubectl("delete", "-f", cephfsPath+cephfsProvisionerRBAC) + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", cephfsPath+cephfsProvisionerRBAC) if err != nil { e2elog.Logf("failed to delete provisioner rbac %v", err) } - _, err = framework.RunKubectl("delete", "-f", cephfsPath+cephfsNodePluginRBAC) + _, err = framework.RunKubectl("delete", "--ignore-not-found", "-f", cephfsPath+cephfsNodePluginRBAC) if err != nil { e2elog.Logf("failed to delete nodeplugin rbac %v", err) }