]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Allow FQDN in Connect Cluster form -> Cluster API URL 65622/head
authorAashish Sharma <Aashish.Sharma1@ibm.com>
Wed, 17 Sep 2025 11:53:01 +0000 (17:23 +0530)
committerAashish Sharma <Aashish.Sharma1@ibm.com>
Mon, 22 Sep 2025 12:22:10 +0000 (17:52 +0530)
Allow the user to enter URL with FQDN in the Cluster API URL filed in
the Connect Cluster form inside Multi-cluster tab.

Fixes: https://tracker.ceph.com/issues/73077
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 8b088d41d751a9c98d152ddb63a9a01111b6340b)

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

index 596ddff11ecf5a2f10e0410d21d489a2fc8caf46..481cf9ddce6516111547393f23237d50b7e2b1b8 100644 (file)
@@ -19,9 +19,6 @@ import { NotificationService } from '~/app/shared/services/notification.service'
 export class MultiClusterFormComponent implements OnInit, OnDestroy {
   @Output()
   submitAction = new EventEmitter();
-  readonly endpoints = /^((https?:\/\/)|(www.))(?:([a-zA-Z]+)|(\d+\.\d+.\d+.\d+)):\d{2,5}\/?$/;
-  readonly ipv4Rgx = /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i;
-  readonly ipv6Rgx = /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i;
   clusterApiUrlCmd = 'ceph mgr services';
   remoteClusterForm: CdFormGroup;
   connectionVerified: boolean;
@@ -102,17 +99,7 @@ export class MultiClusterFormComponent implements OnInit, OnDestroy {
       ),
       remoteClusterUrl: new FormControl(null, {
         validators: [
-          CdValidators.custom('endpoint', (value: string) => {
-            if (_.isEmpty(value)) {
-              return false;
-            } else {
-              return (
-                !this.endpoints.test(value) &&
-                !this.ipv4Rgx.test(value) &&
-                !this.ipv6Rgx.test(value)
-              );
-            }
-          }),
+          CdValidators.url,
           CdValidators.custom('hubUrlCheck', (remoteClusterUrl: string) => {
             return this.action === 'connect' && remoteClusterUrl?.includes(this.hubUrl);
           }),