Move "extra" namespaces into framework

Now an aborted test will delete namespaces.  Hopefully this means less GCE
leaks.
This commit is contained in:
Tim Hockin
2016-02-05 21:38:52 -08:00
parent 677d4d6dbc
commit ff3f9f6bcc
4 changed files with 33 additions and 47 deletions

View File

@@ -75,15 +75,8 @@ var _ = Describe("ClusterDns [Feature:Example]", func() {
namespaces := []*api.Namespace{nil, nil}
for i := range namespaces {
var err error
namespaces[i], err = createTestingNS(fmt.Sprintf("dnsexample%d", i), c, nil)
if testContext.DeleteNamespace {
if namespaces[i] != nil {
defer deleteNS(c, namespaces[i].Name, 5*time.Minute /* namespace deletion timeout */)
}
Expect(err).NotTo(HaveOccurred())
} else {
Logf("Found DeleteNamespace=false, skipping namespace deletion!")
}
namespaces[i], err = framework.CreateNamespace(fmt.Sprintf("dnsexample%d", i), nil)
Expect(err).NotTo(HaveOccurred())
}
for _, ns := range namespaces {