Issues a warning when creating a replicated pool and the replicated size
is 1. It won't stop the user from creating the pool, but will give the
user a hint that no replication will be created.
Fixes: https://tracker.ceph.com/issues/42404
Signed-off-by: Sebastian Krah <skrah@suse.com>
(cherry picked from commit
af1a7dbfe2b0e2e40650d64d4c3247f4961743c2)
Conflicts:
src/pybind/mgr/dashboard/frontend/src/styles/defaults/_bootstrap-defaults.scss
- The file does not exist in octopus, moving a slightly changed version of the diff
to src/pybind/mgr/dashboard/frontend/src/styles.scss instead
*ngIf="form.showError('size', formDir)"
i18n>The size specified is out of range. A value from
{{ getMinSize() }} to {{ getMaxSize() }} is usable.</span>
+ <span class="text-warning-dark"
+ *ngIf="form.getValue('size') === 1"
+ i18n>A size of 1 will not create a replication of the
+ object. The 'Replicated size' includes the object itself.</span>
</div>
</div>
formHelper.expectValidChange('size', 2);
});
+ it('validates if warning is displayed when size is 1', () => {
+ formHelper.setValue('poolType', 'replicated');
+ formHelper.expectValid('size');
+
+ formHelper.setValue('size', 1, true);
+ expect(fixtureHelper.getElementByCss('#size ~ .text-warning-dark')).toBeTruthy();
+
+ formHelper.setValue('size', 2, true);
+ expect(fixtureHelper.getElementByCss('#size ~ .text-warning-dark')).toBeFalsy();
+ });
+
it('validates compression mode default value', () => {
expect(form.getValue('mode')).toBe('none');
});
$font-family-icon: 'ForkAwesome';
// Bootstrap
+$warning-dark: #fd7e14;
$theme-colors: (
'primary': $color-primary,
'secondary': $color-accent,
- 'dark': $color-mild-gray
+ 'dark': $color-mild-gray,
+ 'warning-dark': $warning-dark
);
$font-family-sans-serif: 'Helvetica Neue', Helvetica, Arial, 'Noto Sans', sans-serif,