Repository navigation
mgr/dashboard: Current security configuration should be visible in edit page of nvme gateway service - #70733
Conversation
390cc53 to
5f6dbf7
Compare
5f6dbf7 to
3544a4a
Compare
|
jenkins test dashboard |
|
jenkins test dashboard cephadm |
1 similar comment
|
jenkins test dashboard cephadm |
afreen23
left a comment
There was a problem hiding this comment.
This PR does a lot: edit-mode for gateway groups, shared component template reshuffling, text-label-list label positioning fix, certificate-authority-form layout rewrite. That's too many concerns for one PR, but reviewing what's here:
Shared component changes — need extra scrutiny
text-label-list template change affects ALL consumers
The label positioning change (moving {{ $index === 0 ? label : '' }} from after the input div to a block before it, with ​ for subsequent items) affects every consumer: service-form uses this component ~10 times for DNS names, SANs, custom configs, etc. The cds-text-label component expects its text content projection to be the label — moving it from after the input to before changes rendering order. Has this been tested against the service-form (RGW, ingress, NFS) edit flows?
certificate-authority-form layout rewrite
Replacing cdsRow/cdsCol/[condensed] grid with [cdsStack] throughout the certificate display. This is a visual-only change but it alters spacing for the existing service-form consumer too. The service-form mounts this component inside its own grid context — switching from grid to stack may break alignment there.
Functional issues
1. service_id change in tests is suspicious
Tests now expect service_id: 'default' instead of service_id: 'nvmeof.default'. The create path sets serviceId = groupName (not nvmeof.${groupName}). But the orchestrator/cephadm expects service_id to be the full nvmeof.<group> form for NVMe-oF services. If this is correct, it contradicts how service_id works for other service types. Verify against the backend CephService.create endpoint.
2. pendingHostReload race condition
The pendingHostReload flag in gateway-node component retries getHosts after the current fetch completes. But if the preselection arrives, sets pendingHostReload=true, and then the fetch finishes and re-fetches — the preselection might not be applied because preSelectedHostnames was set before the second fetch even started. The ngOnChanges handler for preSelectedHostnames only fires on input changes, not on data reload. Does the second fetch correctly apply preselection?
3. encryptionKey required validator removed silently
In the original code, when encryption is enabled, the form requires an encryption key (there's a required error span in the template). The PR changes enableEncryption.valueChanges to clear errors on disable, but on enable it no longer adds Validators.required to encryptionKey. The helper text changes to "Optional" — is it really optional to have encryption enabled with no key? If the backend requires it, the form will submit invalid data.
4. enableEncryption is now driven by !!encryptionKey not !!spec.ssl
populateFormFromService sets enableEncryption: !!encryptionKey. Previously it was enableEncryption: spec.ssl || false. These are different — a service can have ssl: true (mTLS) without encryption_key. This changes the semantics of the checkbox. The original meaning was "this group uses TLS/encryption at all"; now it means "this group has a specific encryption key set." Is that correct?
5. cols="100" replaced with class="w-100" for textareas
w-100 is a Bootstrap utility class. Per project rules, Bootstrap classes should not be used. Use style="width: 100%" or a Carbon token.
Missing
- No unit tests for
text-label-listlabel positioning change - No unit tests for
certificate-authority-formlayout (existing consumers) pendingHostReloadlogic has no test coverage
|
LGTM. The flow works as expected |
3544a4a to
d301e3c
Compare
There was a problem hiding this comment.
Pull request overview
Displays existing NVMe/TCP gateway security and host settings when editing.
Changes:
- Prepopulates encryption, mTLS, certificates, and gateway hosts.
- Reuses the shared certificate authority form.
- Adds host reload and edit-mode tests.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
text-label-list.component.spec.ts |
Tests label positioning. |
text-label-list.component.html |
Aligns repeated inputs. |
certificate-authority-form.component.html |
Refines certificate layout. |
nvmeof-group-form.component.ts |
Loads and submits edit settings. |
nvmeof-group-form.component.spec.ts |
Tests edit prepopulation and submission. |
nvmeof-group-form.component.html |
Displays security and certificate controls. |
nvmeof-gateway-node.component.ts |
Adds host reload and security details. |
nvmeof-gateway-node.component.spec.ts |
Tests host reload behavior. |
block.module.ts |
Imports the certificate form. |
Suppressed comments (2)
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-group-form/nvmeof-group-form.component.ts:268
- This fallback also runs after host loading has completed. If an editor deliberately deselects every row,
selectedis empty and the original placement is silently submitted, so the button remains enabled and the user's change is ignored. Limit the fallback to the period while the child table is actually loading; once loaded, an empty selection must remain empty and fail the existing validation.
private getSelectedOrPreselectedHosts(): string[] {
const selected = this.gatewayNodeComponent?.getSelectedHostnames?.() || [];
if (selected.length > 0) {
return selected;
}
// Edit: fall back to loaded placement while table selection syncs
return this.editing ? this.preSelectedHostnames : [];
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-group-form/nvmeof-group-form.component.ts:355
- The service update endpoint is task-backed and may return HTTP 202 before orchestration finishes. This path treats that acceptance response as final success, drops task tracking, and tells the user the group was updated even if the asynchronous task later fails. Keep the task registered and report success/failure from its completion; the separate transient gateway-read race should be suppressed without discarding the update task outcome.
if (this.editing) {
// On edit, navigate immediately once the orchestrator accepts the spec (HTTP 200/202).
// Using taskWrapperService here would subscribe to the async task poller, which races
// against the daemon restart and spuriously raises "Gateway group does not exist" from
// the NVMe-oF gRPC layer before the new daemon is ready.
d301e3c to
04e7262
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-node/nvmeof-gateway-node.component.spec.ts:258
- These tests do not exercise the retry path.
of([])completes synchronously before the secondgetHosts()call, and manually settingisLoadingHostsafterward leaves no active subscription whosefinalizecan launch the pending reload; the other two tests only cover ordinary single fetches. Use aSubjector delayed observable, callgetHosts()again before completing it, then complete it and assert that the API was called twice and the updated preselection was applied.
it('should set pendingHostReload when getHosts is called while a fetch is in-flight', fakeAsync(() => {
spyOn(nvmeofService, 'getAvailableHosts').and.returnValue(of([]));
component.getHosts(new CdTableFetchDataContext(() => undefined));
component.isLoadingHosts = true;
component.getHosts(new CdTableFetchDataContext(() => undefined));
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-group-form/nvmeof-group-form.component.ts:349
- Require all five PEM controls when mTLS uses an external certificate. Switching an existing internal service to External leaves these values empty, so this branch sends
certificate_source: 'inline'while omitting every certificate;NvmeofServiceSpec.validate()rejects that payload (service_spec.py:2254-2265). The general service form already applies conditional required validators for this case (service-form.component.ts:238-301), so this form should block submission in the same way.
if (formValues.certificateType === CertificateType.external) {
if (formValues.rootCACert) {
serviceSpec['root_ca_cert'] = formValues.rootCACert;
}
if (formValues.clientCert) {
src/pybind/mgr/dashboard/frontend/src/app/shared/components/text-label-list/text-label-list.component.spec.ts:155
- This test never checks for a zero-width space; it only counts labels, so it still passes if the template renders empty content. Assert that each subsequent label's
textContentcontains\u200Bto cover the behavior named by the test.
it('should project a zero-width space as content for subsequent rows', () => {
component.writeValue(['a', 'b']);
fixture.detectChanges();
// The template uses ​ for rows after the first; the component
// must render 3 cds-text-label elements (a, b, and empty trailing input).
const labels = fixture.debugElement.queryAll(By.css('cds-text-label'));
expect(labels.length).toBe(3);
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-group-form/nvmeof-group-form.component.ts:368
- Do not treat the edit HTTP response as completed work. The service update endpoint is task-decorated and can return 202; bypassing
TaskWrapperServiceimmediately shows success and navigates away without registering the executing task, so a later orchestration failure is invisible. Keep task tracking for edits and address any daemon-restart race in the task handling instead.
if (this.editing) {
this.cephServiceService
.update(serviceSpec)
.pipe(
tap(() => {
04e7262 to
88c09d0
Compare
|
jenkins test dashboard cephadm |
|
jenkins test dashboard |
|
jenkins test dashboard cephadm |
|
jenkins test dashboard cephadm |
c0a6648 to
d9966a4
Compare
d9966a4 to
9fc6816
Compare
9fc6816 to
4051e31
Compare
|
jenkins test dashboard |
|
jenkins test dashboard |
2 similar comments
|
jenkins test dashboard |
|
jenkins test dashboard |
4051e31 to
e969d52
Compare
|
jenkins test dashboard |
…it page of nvme gateway service Fixes: https://tracker.ceph.com/issues/78889 Signed-off-by: pujaoshahu <[email protected]>
e969d52 to
7698a00
Compare
|
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 |
Fixes: https://tracker.ceph.com/issues/78889
Signed-off-by: pujasohahu [email protected]
Summary :
Show current NVMe/TCP gateway security settings on the edit page (encryption key, mTLS/enable_auth, certificate type and cert fields).
Reuse cd-certificate-authority-form for mTLS certificate UI, and preselect existing hosts when editing a gateway group.
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.