From: Sagar Gopale Date: Mon, 9 Mar 2026 12:22:41 +0000 (+0530) Subject: mgr/dashboard: fix add host API path for namespace mapping in NVMe/TCP X-Git-Tag: v21.0.0~60^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F67716%2Fhead;p=ceph.git mgr/dashboard: fix add host API path for namespace mapping in NVMe/TCP fixes: https://tracker.ceph.com/issues/75407 Signed-off-by: Sagar Gopale --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.spec.ts index 9ce80fcd448f..70b7dcc2a29c 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.spec.ts @@ -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', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.ts index 8fc6b43eba83..ba5810aba7b0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/nvmeof.service.ts @@ -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) {