</div>
<!-- Applications -->
<div class="form-group row">
- <label i18n
- class="cd-col-form-label"
- for="applications">Applications</label>
+ <label class="cd-col-form-label required"
+ for="applications">
+ <ng-container i18n>Applications</ng-container>
+ <cd-helper>
+ <span i18n>Pools need to be associated with an application before use</span>
+ </cd-helper>
+ </label>
<div class="cd-col-form-input">
<cd-select-badges id="applications"
+ name="applications"
[customBadges]="true"
[customBadgeValidators]="data.applications.validators"
[messages]="data.applications.messages"
title="Pools should be associated with an application tag"
class="{{icons.warning}} icon-warning-color">
</i>
+ <span class="invalid-feedback"
+ *ngIf="!isApplicationsSelected && data.applications.selected <= 0"
+ i18n>Application selection is required!</span>
</div>
</div>
<!-- Mirroring -->
// Mock that no ec profiles exist
infoReturn.erasure_code_profiles = [];
setUpPoolComponent();
+ component.data.applications.selected = ['cephfs', 'rgw'];
setMultipleValues({
name: 'minECPool',
poolType: 'erasure',
pool: 'minECPool',
pool_type: 'erasure',
pg_autoscale_mode: 'off',
- pg_num: 4
+ pg_num: 4,
+ application_metadata: ['cephfs', 'rgw']
});
});
it('creates ec pool with erasure coded profile', () => {
+ component.data.applications.selected = ['cephfs', 'rgw'];
const ecp = { name: 'ecpMinimalMock' };
setMultipleValues({
erasureProfile: ecp
});
expectEcSubmit({
- erasure_code_profile: ecp.name
+ erasure_code_profile: ecp.name,
+ application_metadata: ['cephfs', 'rgw']
});
});
it('creates ec pool with ec_overwrite flag', () => {
+ component.data.applications.selected = ['cephfs', 'rgw'];
setMultipleValues({
ecOverwrites: true
});
expectEcSubmit({
- flags: ['ec_overwrites']
+ flags: ['ec_overwrites'],
+ application_metadata: ['cephfs', 'rgw']
});
});
it('should ignore replicated set settings for ec pools', () => {
+ component.data.applications.selected = ['cephfs', 'rgw'];
setMultipleValues({
size: 2 // will be ignored
});
- expectEcSubmit({});
+ expectEcSubmit({
+ application_metadata: ['cephfs', 'rgw']
+ });
});
it('creates a pool with compression', () => {
+ component.data.applications.selected = ['cephfs', 'rgw'];
setMultipleValues({
mode: 'passive',
algorithm: 'lz4',
compression_algorithm: 'lz4',
compression_min_blob_size: 4096,
compression_max_blob_size: 4194304,
- compression_required_ratio: 0.7
+ compression_required_ratio: 0.7,
+ application_metadata: ['cephfs', 'rgw']
});
});
size: 2,
pgNum: 32
});
+ component.data.applications.selected = ['cephfs', 'rgw'];
expectValidSubmit({
pool: 'minRepPool',
pool_type: 'replicated',
pg_num: 32,
pg_autoscale_mode: 'off',
- size: 2
+ size: 2,
+ application_metadata: ['cephfs', 'rgw']
});
});
* if type `replicated` is set, pgNum will be set to 256 with the current rule for
* a replicated pool.
*/
+ component.data.applications.selected = ['cephfs', 'rgw'];
expectReplicatedSubmit({
- pg_num: 256
+ pg_num: 256,
+ application_metadata: ['cephfs', 'rgw']
});
});
max_bytes: 1024 * 1024,
max_objects: 3000
});
+ component.data.applications.selected = ['cephfs', 'rgw'];
expectReplicatedSubmit({
quota_max_bytes: 1024 * 1024,
- quota_max_objects: 3000
+ quota_max_objects: 3000,
+ application_metadata: ['cephfs', 'rgw']
});
});
component.currentConfigurationValues = {
rbd_qos_bps_limit: 55
};
+ component.data.applications.selected = ['cephfs', 'rgw'];
expectReplicatedSubmit({
configuration: {
rbd_qos_bps_limit: 55
- }
+ },
+ application_metadata: ['cephfs', 'rgw']
});
});
});
ecpUsage: string[] = undefined; // Will only be set if a rule is used by some pool
crushRuleMaxSize = 10;
DEFAULT_RATIO = 0.875;
+ isApplicationsSelected = true;
private modalSubscription: Subscription;
if (apps.includes('rbd')) {
pool['rbd_mirroring'] = this.form.getValue('rbdMirroring');
}
+ this.isApplicationsSelected = true;
+ } else {
+ this.isApplicationsSelected = false;
}
// Only collect configuration data for replicated pools, as QoS cannot be configured on EC
pool['configuration'] = this.currentConfigurationValues;
}
+ if (!this.isApplicationsSelected) {
+ this.form.setErrors({ cdSubmitButton: true });
+ return;
+ }
+
this.triggerApiTask(pool);
}