Skip to content

Commit 8b088d4

Browse files
committed
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 <[email protected]>
1 parent bafdbd6 commit 8b088d4

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ import { NotificationService } from '~/app/shared/services/notification.service'
1919
export class MultiClusterFormComponent implements OnInit, OnDestroy {
2020
@Output()
2121
submitAction = new EventEmitter();
22-
readonly endpoints = /^((https?:\/\/)|(www.))(?:([a-zA-Z]+)|(\d+\.\d+.\d+.\d+)):\d{2,5}\/?$/;
23-
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;
24-
readonly ipv6Rgx = /^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i;
2522
clusterApiUrlCmd = 'ceph mgr services';
2623
remoteClusterForm: CdFormGroup;
2724
connectionVerified: boolean;
@@ -102,17 +99,7 @@ export class MultiClusterFormComponent implements OnInit, OnDestroy {
10299
),
103100
remoteClusterUrl: new FormControl(null, {
104101
validators: [
105-
CdValidators.custom('endpoint', (value: string) => {
106-
if (_.isEmpty(value)) {
107-
return false;
108-
} else {
109-
return (
110-
!this.endpoints.test(value) &&
111-
!this.ipv4Rgx.test(value) &&
112-
!this.ipv6Rgx.test(value)
113-
);
114-
}
115-
}),
102+
CdValidators.url,
116103
CdValidators.custom('hubUrlCheck', (remoteClusterUrl: string) => {
117104
return this.action === 'connect' && remoteClusterUrl?.includes(this.hubUrl);
118105
}),

0 commit comments

Comments
 (0)