def teardown(self): """ Delete objects created in roughly reverse order of how they were created. """ self.cb_examples.delete() self.cb_worker.delete() self.cb_deploy.delete() self.pod_obj.exec_oc_cmd( command="delete rolebinding couchbase-operator-rolebinding") self.pod_obj.exec_oc_cmd( command="delete serviceaccount couchbase-operator") self.operator_role.delete() self.couchbase_obj.delete() switch_to_project('default') self.pod_obj.delete_project(constants.COUCHBASE_OPERATOR) for adm_yaml in self.admission_parts: adm_data = templating.load_yaml(adm_yaml) adm_obj = OCS(**adm_data) adm_obj.delete() # Before the code below was added, the teardown task would sometimes # fail with the leftover objects because it would still see one of the # couchbase pods. for admin_pod in TimeoutSampler(self.WAIT_FOR_TIME, 3, get_pod_name_by_pattern, 'couchbase', 'default'): if admin_pod: continue else: break PillowFight.cleanup(self) switch_to_default_rook_cluster_project()
def teardown(self): """ Cleaning up the resources created during Couchbase deployment """ if self.cb_create_cb_secret: self.cb_secrets.delete() if self.cb_create_cb_cluster: self.cb_example.delete() if self.cb_create_bucket: self.cb_bucket.delete() self.subscription_yaml.delete() switch_to_project("default") self.ns_obj.delete_project(constants.COUCHBASE_OPERATOR) self.ns_obj.wait_for_delete(resource_name=constants.COUCHBASE_OPERATOR, timeout=90) PillowFight.cleanup(self) switch_to_default_rook_cluster_project()
def teardown(self): """ Delete objects created in roughly reverse order of how they were created. """ self.cb_examples.delete() self.cb_worker.delete() self.cb_deploy.delete() self.pod_obj.exec_oc_cmd( command= "delete rolebinding couchbase-operator-rolebinding -n couchbase-operator-namespace" ) self.pod_obj.exec_oc_cmd( command= "delete serviceaccount couchbase-operator -n couchbase-operator-namespace" ) self.operator_role.delete() self.couchbase_obj.delete() switch_to_project("default") self.ns_obj.delete_project(constants.COUCHBASE_OPERATOR) self.ns_obj.wait_for_delete(resource_name=constants.COUCHBASE_OPERATOR, timeout=90) for adm_obj in self.adm_objects: adm_obj.delete() # Before the code below was added, the teardown task would sometimes # fail with the leftover objects because it would still see one of the # couchbase pods. for admin_pod in TimeoutSampler(self.WAIT_FOR_TIME, 3, get_pod_name_by_pattern, "couchbase", "default"): if admin_pod: continue else: break PillowFight.cleanup(self) switch_to_default_rook_cluster_project()