]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/rook: orch rm no longer uses rook api delete
authorJoseph Sawaya <jsawaya@redhat.com>
Wed, 22 Sep 2021 20:46:14 +0000 (16:46 -0400)
committerJoseph Sawaya <jsawaya@redhat.com>
Mon, 27 Sep 2021 18:52:59 +0000 (14:52 -0400)
This commit changes orch rm to no longer use the rook api to delete the daemon
but instead directly delete the corresponding CR using the kubernetes api.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
src/pybind/mgr/rook/rook_cluster.py

index df7f7fabbfbb94a31579d47ebbac587f6e3a9db1..486409354178847bac3308b568fd21f36cc0e6e3 100644 (file)
@@ -1007,18 +1007,8 @@ class RookCluster(object):
                 _update_nfs, _create_nfs)
 
     def rm_service(self, rooktype: str, service_id: str) -> str:
-
+        self.customObjects_api.delete_namespaced_custom_object(group="ceph.rook.io", version="v1", namespace="rook-ceph", plural=rooktype, name=service_id)
         objpath = "{0}/{1}".format(rooktype, service_id)
-
-        try:
-            self.rook_api_delete(objpath)
-        except ApiException as e:
-            if e.status == 404:
-                log.info("{0} service '{1}' does not exist".format(rooktype, service_id))
-                # Idempotent, succeed.
-            else:
-                raise
-
         return f'Removed {objpath}'
 
     def can_create_osd(self) -> bool: