mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
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).
This commit is contained in:
parent
17eb9fb47b
commit
b812ec26df
@ -56,22 +56,22 @@ func removeCephCSIResource() {
|
|||||||
|
|
||||||
// cleanup rbd cluster roles deployed by rook
|
// cleanup rbd cluster roles deployed by rook
|
||||||
rbdPath := fmt.Sprintf("%s/%s/", rbdDirPath, "v1.13")
|
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 {
|
if err != nil {
|
||||||
e2elog.Logf("failed to delete provisioner rbac %v", err)
|
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 {
|
if err != nil {
|
||||||
e2elog.Logf("failed to delete nodeplugin rbac %v", err)
|
e2elog.Logf("failed to delete nodeplugin rbac %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup cephfs cluster roles deployed by rook
|
// cleanup cephfs cluster roles deployed by rook
|
||||||
cephfsPath := fmt.Sprintf("%s/%s/", cephfsDirPath, "v1.13")
|
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 {
|
if err != nil {
|
||||||
e2elog.Logf("failed to delete provisioner rbac %v", err)
|
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 {
|
if err != nil {
|
||||||
e2elog.Logf("failed to delete nodeplugin rbac %v", err)
|
e2elog.Logf("failed to delete nodeplugin rbac %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user