]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix add host API path for namespace mapping in NVMe/TCP 67716/head
authorSagar Gopale <sagar.gopale@ibm.com>
Mon, 9 Mar 2026 12:22:41 +0000 (17:52 +0530)
committerSagar Gopale <sagar.gopale@ibm.com>
Mon, 9 Mar 2026 12:22:41 +0000 (17:52 +0530)
fixes: https://tracker.ceph.com/issues/75407

Signed-off-by: Sagar Gopale <sagar.gopale@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.ts

index 9ce80fcd448f2714a24e7af196480bcb7f21352b..70b7dcc2a29c60b3cdb69249a2c1dd0e8975f0d6 100755 (executable)
@@ -285,6 +285,18 @@ describe('NvmeofService', () => {
       );
       expect(req.request.method).toBe('DELETE');
     });
+
+    it('should call addNamespaceInitiators with UI namespace host endpoint', () => {
+      const request = {
+        subsystem_nqn: mockNQN,
+        host_nqn: 'nqn.2014-08.org.nvmexpress:uuid:11111111-1111-1111-1111-111111111111',
+        gw_group: mockGroupName
+      };
+      service.addNamespaceInitiators(mockNsid, request).subscribe();
+      const req = httpTesting.expectOne(`${UI_API_PATH}/namespace/${mockNsid}/host`);
+      expect(req.request.method).toBe('POST');
+      expect(req.request.body).toEqual(request);
+    });
   });
 
   describe('getHostsForGroup', () => {
index 8fc6b43eba8385811711af0ac9e7a1535fca7b98..ba5810aba7b0c7603a55091d97dfdf613fb266e4 100644 (file)
@@ -223,13 +223,9 @@ export class NvmeofService {
   }
 
   addNamespaceInitiators(nsid: number | string, request: NamespaceInitiatorRequest) {
-    return this.http.post(
-      `${UI_API_PATH}/subsystem/${request.subsystem_nqn}/namespace/${nsid}/host`,
-      request,
-      {
-        observe: 'response'
-      }
-    );
+    return this.http.post(`${UI_API_PATH}/namespace/${nsid}/host`, request, {
+      observe: 'response'
+    });
   }
 
   updateHostKey(subsystemNQN: string, request: InitiatorRequest) {