]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Dashboard incorrectly displays mTLS as "Disabled" for NVMe-oF service... 70731/head
authorpujashahu <pshahu@redhat.com>
Thu, 30 Jul 2026 20:03:26 +0000 (01:33 +0530)
committerpujashahu <pshahu@redhat.com>
Thu, 30 Jul 2026 20:03:26 +0000 (01:33 +0530)
Fixes: https://tracker.ceph.com/issues/78896
Signed-off-by: pujaoshahu <pshahu@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.ts

index 09ca8c4c34efd48758e0a5424f7108d2355f6313..390420ed03877942c4d8c0cba6280c4a10f3785e 100644 (file)
@@ -422,6 +422,43 @@ describe('NvmeofGatewayNodeComponent', () => {
     expect(component.hosts[0].hostname).toBe('gateway-node-1');
   }));
 
+  it('should show Encryption and mTLS status from encryption_key and enable_auth', fakeAsync(() => {
+    (component as any).route.snapshot.data = { mode: 'details' };
+    component.ngOnInit();
+    component.groupName = 'group1';
+
+    spyOn(nvmeofService, 'fetchHostsAndGroups').and.returnValue(
+      of({
+        groups: [
+          [
+            {
+              service_id: 'nvmeof.group1',
+              spec: {
+                group: 'group1',
+                encryption_key: 'test-encryption-key',
+                enable_auth: false
+              },
+              placement: { hosts: ['gateway-node-1'] }
+            }
+          ]
+        ],
+        hosts: mockGatewayNodes
+      } as any)
+    );
+
+    fixture.detectChanges();
+    component.getHosts(new CdTableFetchDataContext(() => undefined));
+    tick(100);
+
+    const encryptionDetail = component.gatewayDetails.find((d) => d.label === 'Encryption');
+    const mtlsDetail = component.gatewayDetails.find((d) => d.label === 'mTLS');
+
+    expect(encryptionDetail.value).toBe('Enabled');
+    expect(encryptionDetail.statusIcon).toBe('success');
+    expect(mtlsDetail.value).toBe('Disabled');
+    expect(mtlsDetail.statusIcon).toBe('error');
+  }));
+
   it('should set selectionType to multiClick in selector mode', () => {
     (component as any).route.snapshot.data = { mode: 'selector' };
     component.ngOnInit();
index 01e4f48c88ee56c75071e8dbe2854754592b5816..076fd13b7b8cff906a728e4830317f626038638f 100644 (file)
@@ -452,9 +452,9 @@ export class NvmeofGatewayNodeComponent implements OnInit, OnDestroy, OnChanges
       },
       {
         label: $localize`Encryption`,
-        value: serviceSpec.spec?.enable_auth ? $localize`Enabled` : $localize`Disabled`,
+        value: serviceSpec.spec?.encryption_key ? $localize`Enabled` : $localize`Disabled`,
         type: 'status',
-        statusIcon: serviceSpec.spec?.enable_auth ? 'success' : 'error'
+        statusIcon: serviceSpec.spec?.encryption_key ? 'success' : 'error'
       },
       {
         label: $localize`mTLS`,