func cleanup(oc *exutil.CLI) { exutil.DumpImageStreams(oc) oc.AsAdmin().Run("delete").Args("all", "--all", "-n", oc.Namespace()).Execute() exutil.DumpImageStreams(oc) oc.AsAdmin().Run("delete").Args("pvc", "--all", "-n", oc.Namespace()).Execute() exutil.CleanupHostPathVolumes(oc.AdminKubeClient().Core().PersistentVolumes(), oc.Namespace()) }
func cleanup(oc *exutil.CLI) { oc.AsAdmin().Run("delete").Args("all", "--all", "-n", oc.Namespace()).Execute() oc.AsAdmin().Run("delete").Args("pvc", "--all", "-n", oc.Namespace()).Execute() exutil.CleanupHostPathVolumes(oc.AdminKubeREST().PersistentVolumes(), oc.Namespace()) }
g.It(fmt.Sprintf("should process and create the %q template", templatePath), func() { oc.SetOutputDir(exutil.TestContext.OutputDir) g.By("creating persistent volumes") _, err := exutil.SetupHostPathVolumes( oc.AdminKubeREST().PersistentVolumes(), oc.Namespace(), "256Mi", 3, ) o.Expect(err).NotTo(o.HaveOccurred()) defer func() { // We're removing only PVs because all other things will be removed // together with namespace. err := exutil.CleanupHostPathVolumes(oc.AdminKubeREST().PersistentVolumes(), oc.Namespace()) if err != nil { fmt.Fprintf(g.GinkgoWriter, "WARNING: couldn't cleanup persistent volumes: %v", err) } }() g.By("creating a new app") o.Expect( oc.Run("new-app").Args( "-f", templatePath, "-p", "VOLUME_CAPACITY=256Mi", "-p", "MEMORY_LIMIT=512Mi", "-p", "MONGODB_IMAGE=centos/mongodb-32-centos7", "-p", "MONGODB_SERVICE_NAME=mongodb-replicaset", ).Execute(), ).Should(o.Succeed())