Skip to content

mgr/dashboard : Subsystem Overview incorrectly displays "Restrict to specific hosts" when no active initiators are configured - #70769

Merged
nizamial09 merged 1 commit into
ceph:mainfrom
rhcs-dashboard:fix-subsystem-host
Aug 11, 2026

Conversation

@pujaoshahu

@pujaoshahu pujaoshahu commented Aug 3, 2026 •

Copy link
Copy Markdown
Screencast.From.2026-08-03.14-16-57.mp4
Screencast.From.2026-08-03.14-17-46.mp4

Fixes :https://tracker.ceph.com/issues/78953

Signed-off-by: pujaoshahu [email protected]

Summary :
The Subsystem Overview page incorrectly displays the Host Access status as "Restrict to specific hosts" even when there are no active initiators configured for the subsystem. This results in an inaccurate representation of the subsystem's access configuration. The fix updates the logic to display the correct host access status based on the presence of active initiators.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

The untyped initiator API response causes a TypeScript type-check failure at the new normalization call.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Fixes NVMe-oF subsystem host-access status display by considering both subsystem configuration and active initiators.

Changes:

  • Adds shared initiator normalization and host-access helpers.
  • Updates overview labels/icons and initiator-list logic.
  • Adds regression tests for wildcard removal and presence.
File summaries
File Description
shared/models/nvmeof.ts Adds shared host-access utilities.
nvmeof-subsystem-overview.component.ts Derives and displays effective host access.
nvmeof-subsystem-overview.component.html Adds localized status text and icon.
nvmeof-subsystem-overview.component.spec.ts Tests wildcard host scenarios.
nvmeof-initiators-list.component.ts Reuses shared normalization and access logic.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Copilot AI review requested due to automatic review settings August 3, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

The untyped initiator response causes a TypeScript type-checking error.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details

Suppressed comments (2)

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystem-overview/nvmeof-subsystem-overview.component.ts:90

  • getInitiators() is inferred as Observable<Object> because its HttpClient.get call has no response generic (shared/api/nvmeof.service.ts:299-300). Passing that value directly to normalizeInitiators() fails TypeScript type checking. Please type the service response as NvmeofInitiatorsResponse (preferred) or explicitly narrow/cast it here.
      const initiatorList = normalizeInitiators(initiators);

src/pybind/mgr/dashboard/frontend/src/app/shared/models/nvmeof.ts:131

  • This final sentence contradicts the documented empty-list case and the implementation below: removing * from a list where it is the only entry leaves an empty list, which still returns true. Clarify that restriction applies when specific hosts remain after removal.
 * list or the synthetic "*" (Any) initiator. Removing that initiator means
 * access is restricted even if `allow_any_host` still reports true.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@pujaoshahu
pujaoshahu marked this pull request as ready for review August 3, 2026 08:49
@pujaoshahu
pujaoshahu requested a review from a team as a code owner August 3, 2026 08:49

@afreen23 afreen23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid refactor. Extracting normalizeInitiators and isSubsystemAllowAllHosts into the shared model is the right call — deduplicates logic across initiators-list and subsystem-overview.

The core fix (checking initiator list for * entry rather than trusting allow_any_host alone) is correct. Tests cover both the lag scenario and the synthetic * case.

Two things to address:

1. disable: () => false removes the guard on Add Initiator entirely

The old code disabled the "Add" button when hasAllHostsAllowed() was true. This PR changes it to disable: () => false, meaning the button is always enabled even when allow-all-hosts is active. Was this intentional? If a user has "Allow all hosts" configured, adding individual initiators is contradictory. If this is intentional, add a comment explaining why.

2. getStatusIcon for host-access detail uses detail.value which is now a boolean

In the template:

<cd-icon [type]="getStatusIcon(detail)" class="cds-mr-3"></cd-icon>

getStatusIcon returns detail.value ? 'success' : 'error'. For "Allow all hosts" (value=true) you get a green check, for "Restrict" (value=false) you get a red X. Is "Restrict to specific hosts" really an error state? Restricting access is a security-positive action — showing a red error icon for it is misleading. Consider using 'info' or 'warning' for restrict, or just drop the icon for this field since it's not a health indicator.

Copilot AI review requested due to automatic review settings August 4, 2026 07:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 4, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 4, 2026 07:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@afreen23 afreen23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after COMMENTED review.

Issue #2 (status icon for host-access): ADDRESSED. The getStatusIcon method is removed, replaced with getHostAccessLabel returning plain text. The template no longer renders a success/error icon for host-access, and the HTML comment explains the reasoning. Good fix.

Issue #1 (disable guard on Add Initiator): NOT ADDRESSED. disable: () => false is still present with no reply or explanation. The old code disabled the Add button when hasAllHostsAllowed() returned true, which prevented users from adding individual initiators when allow-all-hosts is active (a contradictory operation). If removing this guard is intentional, please explain why and add a comment. If it was accidental, restore the disable logic.

New issues below.

@github-project-automation github-project-automation Bot moved this from New to Review in progress in Ceph-Dashboard Aug 4, 2026
Copilot AI review requested due to automatic review settings August 4, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 5, 2026 05:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 5, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pujaoshahu
pujaoshahu requested a review from nizamial09 August 5, 2026 09:54

@afreen23 afreen23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. All previous feedback addressed -- type safety on getInitiators, doc comment, blank line cleanup. Shared model additions (normalizeInitiators, isSubsystemAllowAllHosts, NvmeofInitiatorsResponse) are clean and the third consumer (nvmeof-edit-authentication) is compatible.

@afreen23 afreen23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard cephadm

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard cephadm

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard cephadm

@nizamial09

Copy link
Copy Markdown
Member

jenkins test dashboard

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard cephadm

2 similar comments
@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard cephadm

@pujaoshahu

Copy link
Copy Markdown
Author

jenkins test dashboard cephadm

@nizamial09
nizamial09 merged commit d2f4b55 into ceph:main Aug 11, 2026
7 checks passed
@nizamial09
nizamial09 deleted the fix-subsystem-host branch August 11, 2026 05:38
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Aug 11, 2026
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/31462307039

afreen23 added a commit to rhcs-dashboard/ceph that referenced this pull request Oct 5, 2026
…ntacle backport

Add SAVE_CHANGES label constant to ActionLabelsI18n (backported from
PR ceph#68845) required by PR ceph#70937 cherry-pick.
Cherry-pick PR ceph#70769 adds normalizeInitiators and isSubsystemAllowAllHosts
to nvmeof model required by PR ceph#71291.

Signed-off-by: Afreen Misbah <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants