mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Merge pull request #10700 from wojtek-t/remove_unused_namespace
Delete namespace after pods test
This commit is contained in:
commit
3c04300d58
@ -39,6 +39,11 @@ func runLivenessTest(c *client.Client, podDescr *api.Pod, expectRestart bool) {
|
||||
namespace, err := createTestingNS("pods-liveness", c)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
ns := namespace.Name
|
||||
defer func() {
|
||||
if err := c.Namespaces().Delete(ns); err != nil {
|
||||
Failf("Couldn't delete ns %q: %s", namespace, err)
|
||||
}
|
||||
}()
|
||||
|
||||
By(fmt.Sprintf("Creating pod %s in namespace %s", podDescr.Name, ns))
|
||||
_, err = c.Pods(ns).Create(podDescr)
|
||||
@ -90,6 +95,11 @@ func testHostIP(c *client.Client, pod *api.Pod) {
|
||||
namespace, err := createTestingNS("pods-host-ip", c)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
ns := namespace.Name
|
||||
defer func() {
|
||||
if err := c.Namespaces().Delete(ns); err != nil {
|
||||
Failf("Couldn't delete ns %q: %s", namespace, err)
|
||||
}
|
||||
}()
|
||||
|
||||
podClient := c.Pods(ns)
|
||||
By("creating pod")
|
||||
|
Loading…
Reference in New Issue
Block a user