]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: disable NFSv3 support in dashboard 41200/head
authorVolker Theile <vtheile@suse.com>
Thu, 29 Apr 2021 11:21:11 +0000 (13:21 +0200)
committerVolker Theile <vtheile@suse.com>
Mon, 17 May 2021 08:05:43 +0000 (10:05 +0200)
Fixes: https://tracker.ceph.com/issues/49718
Related to: https://github.com/ceph/ceph/pull/40154

Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit 864a362389e988bc9aab23f66da608b4ceab74c0)

src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts

index 11c4ccb22af3abf20b6be72b55fdce38499ceddd..3da1e5820f70e8aa651d2cfe3aa07f444ee27fb3 100644 (file)
                      class="custom-control-input"
                      id="protocolNfsv3"
                      name="protocolNfsv3"
-                     formControlName="protocolNfsv3">
+                     formControlName="protocolNfsv3"
+                     disabled>
               <label i18n
                      class="custom-control-label"
                      for="protocolNfsv3">NFSv3</label>
index 4ebc1288de30bac5f484194e63260d059b13986e..12663f800393832595e2de6dc0448d3263812ebf 100644 (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({
index 5234be1404e8e1f8cc72348b3b4a57750bb84efc..2b110abb48016cc9f36f8cd479d24ff3bbc10c30 100644 (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;