mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
Delete federation namespace after the test completes
This commit is contained in:
parent
debac32d51
commit
d96ad8d570
@ -269,6 +269,10 @@ func (f *Framework) BeforeEach() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *Framework) deleteFederationNs() {
|
func (f *Framework) deleteFederationNs() {
|
||||||
|
if !f.federated {
|
||||||
|
// Nothing to do if this is not a federation setup.
|
||||||
|
return
|
||||||
|
}
|
||||||
ns := f.FederationNamespace
|
ns := f.FederationNamespace
|
||||||
By(fmt.Sprintf("Destroying federation namespace %q for this suite.", ns.Name))
|
By(fmt.Sprintf("Destroying federation namespace %q for this suite.", ns.Name))
|
||||||
timeout := 5 * time.Minute
|
timeout := 5 * time.Minute
|
||||||
@ -327,10 +331,7 @@ func (f *Framework) AfterEach() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Delete the federation namespace.
|
// Delete the federation namespace.
|
||||||
// TODO(nikhiljindal): Uncomment this, once https://github.com/kubernetes/kubernetes/issues/31077 is fixed.
|
f.deleteFederationNs()
|
||||||
// In the meantime, we will have these extra namespaces in all clusters.
|
|
||||||
// Note: this will not cause any failure since we create a new namespace for each test in BeforeEach().
|
|
||||||
// f.deleteFederationNs()
|
|
||||||
} else {
|
} else {
|
||||||
Logf("Found DeleteNamespace=false, skipping namespace deletion!")
|
Logf("Found DeleteNamespace=false, skipping namespace deletion!")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user