From: Volker Theile Date: Thu, 29 Apr 2021 11:21:11 +0000 (+0200) Subject: mgr/dashboard: disable NFSv3 support in dashboard X-Git-Tag: v15.2.14~90^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41199%2Fhead;p=ceph.git mgr/dashboard: disable NFSv3 support in dashboard Fixes: https://tracker.ceph.com/issues/49718 Related to: https://github.com/ceph/ceph/pull/40154 Signed-off-by: Volker Theile (cherry picked from commit 864a362389e988bc9aab23f66da608b4ceab74c0) --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html index 13b94a6cc189..3251ca267db7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html @@ -321,7 +321,8 @@ class="custom-control-input" id="protocolNfsv3" name="protocolNfsv3" - formControlName="protocolNfsv3"> + formControlName="protocolNfsv3" + disabled> diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts index 01da887fefb6..ce3c8bf0d721 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts @@ -94,7 +94,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', @@ -141,6 +141,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({ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts index 5e89174e4861..f742bcac2413 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts @@ -167,7 +167,7 @@ export class NfsFormComponent implements OnInit { }) }), path: new FormControl(''), - protocolNfsv3: new FormControl(true, { + protocolNfsv3: new FormControl(false, { validators: [ CdValidators.requiredIf({ protocolNfsv4: false }, (value: boolean) => { return !value;