mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Dump namespace if the namespace could not be cleaned up
This commit is contained in:
parent
d87c921a51
commit
c3c7ea2efd
@ -334,6 +334,11 @@ func (f *Framework) AfterEach() {
|
|||||||
if err := f.ClientSet.CoreV1().Namespaces().Delete(ns.Name, nil); err != nil {
|
if err := f.ClientSet.CoreV1().Namespaces().Delete(ns.Name, nil); err != nil {
|
||||||
if !apierrors.IsNotFound(err) {
|
if !apierrors.IsNotFound(err) {
|
||||||
nsDeletionErrors[ns.Name] = err
|
nsDeletionErrors[ns.Name] = err
|
||||||
|
|
||||||
|
// Dump namespace if we are unable to delete the namespace and the dump was not already performed.
|
||||||
|
if !ginkgo.CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure {
|
||||||
|
DumpAllNamespaceInfo(f.ClientSet, ns.Name)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Logf("Namespace %v was already deleted", ns.Name)
|
Logf("Namespace %v was already deleted", ns.Name)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user