From 8b088d41d751a9c98d152ddb63a9a01111b6340b Mon Sep 17 00:00:00 2001 From: Aashish Sharma Date: Wed, 17 Sep 2025 17:23:01 +0530 Subject: [PATCH] mgr/dashboard: Allow FQDN in Connect Cluster form -> Cluster API URL 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 --- .../multi-cluster-form.component.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-form/multi-cluster-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-form/multi-cluster-form.component.ts index 596ddff11ecf5..481cf9ddce651 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-form/multi-cluster-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/multi-cluster/multi-cluster-form/multi-cluster-form.component.ts @@ -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); }), -- 2.39.5