]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix renaming of pools 25423/head
authorPatrick Nawracay <pnawracay@suse.com>
Thu, 6 Dec 2018 11:59:20 +0000 (12:59 +0100)
committerPatrick Nawracay <pnawracay@suse.com>
Thu, 6 Dec 2018 11:59:20 +0000 (12:59 +0100)
The validation fails to allow dots in pool names and as such, it wasn't
allowed to create or rename pools with dots in their names.

Fixes: https://tracker.ceph.com/issues/37534
Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts

index 9507b5fb84ad0cf0897b9197a9bd177b0cd099a7..91160ec98c788d2cd9603999ad8009b7dc5077b9 100644 (file)
@@ -229,6 +229,10 @@ describe('PoolFormComponent', () => {
       formHelper.expectErrorChange('name', 'wrong format with spaces', 'pattern');
     });
 
+    it('should validate with dots in pool name', () => {
+      formHelper.expectValidChange('name', 'pool.default.bar', true);
+    });
+
     it('validates poolType', () => {
       formHelper.expectError('poolType', 'required');
       formHelper.expectValidChange('poolType', 'erasure');
index a17802a574cae42174fcc8de5e779b1105ef6135..4a8424f350eba4e27e5b3b9fdbfd5d816f77ccb7 100644 (file)
@@ -100,7 +100,7 @@ export class PoolFormComponent implements OnInit {
     this.form = new CdFormGroup(
       {
         name: new FormControl('', {
-          validators: [Validators.pattern('[A-Za-z0-9_-]+'), Validators.required]
+          validators: [Validators.pattern('[\\.A-Za-z0-9_-]+'), Validators.required]
         }),
         poolType: new FormControl('', {
           validators: [Validators.required]