]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #47179 from rhcs-dashboard/service-id-info
authorPere Diaz Bou <30913090+pereman2@users.noreply.github.com>
Wed, 10 Aug 2022 08:39:38 +0000 (10:39 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Aug 2022 08:39:38 +0000 (10:39 +0200)
mgr/dashboard: validate mds service_id and helper text for service_id

Reviewed-by: Pegonzal <NOT@FOUND>
Reviewed-by: Aashish Sharma <aasharma@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
Reviewed-by: Pere Diaz Bou <pdiazbou@redhat.com>
1  2 
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts

index c9cdc70b0ccec4296e4c2129549b0fdfe257773f,658932c5273485083a1eddce839bd89168d0e498..875b73edca15d1d3c4fc59555edc35474416fb29
                    *ngIf="serviceForm.showError('service_id', frm, 'required')"
                    i18n>This field is required.</span>
              <span class="invalid-feedback"
 +                  *ngIf="serviceForm.showError('service_id', frm, 'uniqueName')"
 +                  i18n>This service id is already in use.</span>
 +            <span class="invalid-feedback"
                    *ngIf="serviceForm.showError('service_id', frm, 'rgwPattern')"
                    i18n>The value does not match the pattern <strong>&lt;service_id&gt;[.&lt;realm_name&gt;.&lt;zone_name&gt;]</strong>.</span>
+             <span class="invalid-feedback"
+                   *ngIf="serviceForm.showError('service_id', frm, 'mdsPattern')"
+                   i18n>MDS service id must start with a letter and contain alphanumeric characters or '.', '-', and '_'</span>
            </div>
          </div>
  
index cfe2bb5b28dcbe82400705660152d049092dd650,4c400a01861ca8fa8c363824f9a8fa529d65c1a4..83bb099fb4151ff7fe1e8e9de2112be67b9e8c4e
@@@ -28,9 -28,9 +28,10 @@@ import { TaskWrapperService } from '~/a
  })
  export class ServiceFormComponent extends CdForm implements OnInit {
    readonly RGW_SVC_ID_PATTERN = /^([^.]+)(\.([^.]+)\.([^.]+))?$/;
+   readonly MDS_SVC_ID_PATTERN = /^[a-zA-Z_.-][a-zA-Z0-9_.-]*$/;
    readonly SNMP_DESTINATION_PATTERN = /^[^\:]+:[0-9]/;
    readonly SNMP_ENGINE_ID_PATTERN = /^[0-9A-Fa-f]{10,64}/g;
 +  readonly INGRESS_SUPPORTED_SERVICE_TYPES = ['rgw', 'nfs'];
    @ViewChild(NgbTypeahead, { static: false })
    typeahead: NgbTypeahead;