Merge pull request #41081 from votdev/issue_49718_disable_nfs_v3

mgr/dashboard: disable NFSv3 support in dashboard

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Alexandra Settle <asettle@suse.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Michael Fritch <mfritch@suse.com>
This commit is contained in:
Ernesto Puerta 2021-05-05 17:47:58 +02:00 committed by GitHub
commit 21ab6c57ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -322,7 +322,8 @@
class="custom-control-input"
id="protocolNfsv3"
name="protocolNfsv3"
formControlName="protocolNfsv3">
formControlName="protocolNfsv3"
disabled>
<label i18n
class="custom-control-label"
for="protocolNfsv3">NFSv3</label>

View File

@ -98,7 +98,7 @@ describe('NfsFormComponent', () => {
daemons: [],
fsal: { fs_name: 'a', name: '', rgw_user_id: '', user_id: '' },
path: '',
protocolNfsv3: true,
protocolNfsv3: false,
protocolNfsv4: true,
pseudo: '',
sec_label_xattr: 'security.selinux',
@ -145,6 +145,15 @@ describe('NfsFormComponent', () => {
expect(component.nfsForm.get('cluster_id').disabled).toBeTruthy();
});
it('should mark NFSv4 protocol as required', () => {
component.nfsForm.patchValue({
protocolNfsv4: false
});
component.nfsForm.updateValueAndValidity({ emitEvent: false });
expect(component.nfsForm.valid).toBeFalsy();
expect(component.nfsForm.get('protocolNfsv4').hasError('required')).toBeTruthy();
});
describe('should submit request', () => {
beforeEach(() => {
component.nfsForm.patchValue({

View File

@ -174,7 +174,7 @@ export class NfsFormComponent extends CdForm implements OnInit {
})
}),
path: new FormControl(''),
protocolNfsv3: new FormControl(true, {
protocolNfsv3: new FormControl(false, {
validators: [
CdValidators.requiredIf({ protocolNfsv4: false }, (value: boolean) => {
return !value;