Fixes: https://tracker.ceph.com/issues/68198
Signed-off-by: Dnyaneshwari Talwekar <dtalweka@redhat.com>
(cherry picked from commit
8a101ef9be5cfaaa9d9703e4ccdda9106416c362)
Conflicts:
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form-modal.component.html
i18n>This field is required.</span>
<span *ngIf="((mirroring === 'snapshot') ? true : null) && (snapshotForm.getValue('mirrorImageSnapshot') === true) ? true: null"
i18n>Snapshot mode is enabled on image <b>{{ imageName }}</b>: snapshot names are auto generated</span>
+ <span *ngIf="snapshotForm.showError('snapshotName', formDir, 'pattern')"
+ class="invalid-feedback"
+ i18n>The snapshot name cannot start with "." and cannot contain "/" and "@".</span>
</div>
</div>
<ng-container *ngIf="(mirroring === 'snapshot') ? true : null">
createForm() {
this.snapshotForm = new CdFormGroup({
snapshotName: new UntypedFormControl('', {
- validators: [Validators.required]
+ validators: [Validators.required, Validators.pattern(/^(?!\.)[^/@]+$/)]
}),
mirrorImageSnapshot: new UntypedFormControl(false, {})
});