@@ -83,8 +83,8 @@ var _ = Describe("Manager", Ordered, func() {
8383 Expect (err ).NotTo (HaveOccurred (), "Failed to patch imagePullPolicy" )
8484 })
8585
86- // After all tests have been executed, clean up by undeploying the controller, uninstalling CRDs,
87- // and deleting the namespace.
86+ // After all tests have been executed, clean up by deleting controller resources
87+ // but NOT the namespace (which contains Velero needed by other test suites) .
8888 AfterAll (func () {
8989 By ("cleaning up the curl pod for metrics" )
9090 cmd := exec .Command ("kubectl" , "delete" , "pod" , "curl-metrics" , "-n" , namespace )
@@ -94,8 +94,20 @@ var _ = Describe("Manager", Ordered, func() {
9494 cmd = exec .Command ("kubectl" , "delete" , "clusterrolebinding" , metricsRoleBindingName )
9595 _ , _ = utils .Run (cmd )
9696
97- By ("undeploying the controller-manager" )
98- cmd = exec .Command ("make" , "undeploy" )
97+ By ("deleting the controller deployment" )
98+ cmd = exec .Command ("kubectl" , "delete" , "deployment" , "oadp-vm-file-restore-controller-manager" , "-n" , namespace , "--ignore-not-found" )
99+ _ , _ = utils .Run (cmd )
100+
101+ By ("deleting controller RBAC resources" )
102+ cmd = exec .Command ("kubectl" , "delete" , "clusterrole,clusterrolebinding,role,rolebinding" , "-l" , "app.kubernetes.io/name=oadp-vm-file-restore" , "--ignore-not-found" )
103+ _ , _ = utils .Run (cmd )
104+
105+ By ("deleting controller service account" )
106+ cmd = exec .Command ("kubectl" , "delete" , "serviceaccount" , serviceAccountName , "-n" , namespace , "--ignore-not-found" )
107+ _ , _ = utils .Run (cmd )
108+
109+ By ("deleting metrics service" )
110+ cmd = exec .Command ("kubectl" , "delete" , "service" , metricsServiceName , "-n" , namespace , "--ignore-not-found" )
99111 _ , _ = utils .Run (cmd )
100112
101113 By ("uninstalling CRDs" )
0 commit comments