New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mgr/dashboard: validate mds service_id and helper text for service_id #47179
Conversation
f8eb999
to
5cf1f37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @melissa-kun-li , just left some comments on a couple things before approving
@@ -80,6 +82,9 @@ | |||
<span class="invalid-feedback" | |||
*ngIf="serviceForm.showError('service_id', frm, 'rgwPattern')" | |||
i18n>The value does not match the pattern <strong><service_id>[.<realm_name>.<zone_name>]</strong>.</span> | |||
<span class="invalid-feedback" | |||
*ngIf="serviceForm.showError('service_id', frm, 'mdsPattern')" | |||
i18n>MDS service_id must match the pattern <strong>^[a-zA-Z_.-][a-zA-Z0-9_.-]*$</strong></span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit:
I would prefer to have a more user-friendly string to show feedback instead of a regex pattern.
Maybe something like:
i18n>MDS service_id must match the pattern <strong>^[a-zA-Z_.-][a-zA-Z0-9_.-]*$</strong></span> | |
i18n>MDS service_id must start with a letter and and can contain alphanumeric characters, '.', '-' or '_'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I agree it can be confusing I think that would work, we are already using it in other places.
...gr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html
Outdated
Show resolved
Hide resolved
...dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts
Outdated
Show resolved
Hide resolved
5cf1f37
to
790a66f
Compare
Thanks for the review @Pegonzal ! Updated now |
jenkins test dashboard |
jenkins test dashboard cephadm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working fine locally, I left a minor comment.
...gr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html
Outdated
Show resolved
Hide resolved
Validate mds service_id to avoid mds daemon from being created and going into error state due to invalid id. Also add helper text to describe the role of service_id. Fixes: https://tracker.ceph.com/issues/56077 Signed-off-by: Melissa Li <melissali@redhat.com>
790a66f
to
1d6cb28
Compare
jenkins test dashboard cephadm |
jenkins test windows |
jenkins test windows |
jenkins test dashboard cephadm |
Cehpadm tests are unrelated Test Result (1 failure / +1) Identified problems 1 of 10 failed (10%) No such file or directory Python Assertion Error (probably from a Unit Test) |
Validate mds service_id to avoid mds daemon from being created and going into error state due to invalid id.
Also add helper text to describe the role of service_id.
Fixes: https://tracker.ceph.com/issues/56077
Signed-off-by: Melissa Li melissali@redhat.com
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows