]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: add required validation for frontend and monitor port
authorAvan Thakkar <athakkar@redhat.com>
Mon, 25 Jul 2022 10:34:00 +0000 (16:04 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Wed, 3 Aug 2022 08:55:32 +0000 (14:25 +0530)
Resolves: rhbz#2080916

Fixes: https://tracker.ceph.com/issues/56688
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit ea770fd858cae9a8b52c60b293f48cc4dbc925f8)

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts

index bccaa496a40320a0af3014dee125f1f6f0644f73..cfe2bb5b28dcbe82400705660152d049092dd650 100644 (file)
@@ -182,8 +182,26 @@ export class ServiceFormComponent extends CdForm implements OnInit {
           })
         ]
       ],
-      frontend_port: [null, [CdValidators.number(false)]],
-      monitor_port: [null, [CdValidators.number(false)]],
+      frontend_port: [
+        null,
+        [
+          CdValidators.number(false),
+          CdValidators.requiredIf({
+            service_type: 'ingress',
+            unmanaged: false
+          })
+        ]
+      ],
+      monitor_port: [
+        null,
+        [
+          CdValidators.number(false),
+          CdValidators.requiredIf({
+            service_type: 'ingress',
+            unmanaged: false
+          })
+        ]
+      ],
       virtual_interface_networks: [null],
       // RGW, Ingress & iSCSI
       ssl: [false],