]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Crush rule is only send during replicated pool creation
authorStephan Müller <smueller@suse.com>
Mon, 2 Mar 2020 11:26:48 +0000 (12:26 +0100)
committerStephan Müller <smueller@suse.com>
Mon, 9 Mar 2020 11:35:58 +0000 (12:35 +0100)
The problem was that the crush rule setting was send during the creation
of a pool - the type didn't matter, but the setting is only used if a
replicated pool is created. This hasn't created any problems yet, but to
prevent that it's now omitted for erasure code pool creations.

Fixes: https://tracker.ceph.com/issues/44371
Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts

index f67adba02b8fe76dc306e59b6814c0e34d5cb227..8e3e18f53bf4325e8ed7fe017c46d0374fdf82b3 100644 (file)
@@ -574,7 +574,11 @@ export class PoolFormComponent implements OnInit {
             formControlName: 'erasureProfile',
             attr: 'name'
           },
-      { externalFieldName: 'rule_name', formControlName: 'crushRule', attr: 'rule_name' },
+      {
+        externalFieldName: 'rule_name',
+        formControlName: 'crushRule',
+        replaceFn: (value: CrushRule) => (this.isReplicated ? value && value.rule_name : undefined)
+      },
       {
         externalFieldName: 'quota_max_bytes',
         formControlName: 'max_bytes',