From 7fa3531036c12be7ccbaec1fb2416e0c08a4c69c Mon Sep 17 00:00:00 2001 From: Dmitry Gusev Date: Tue, 28 Nov 2023 14:22:33 +0300 Subject: [PATCH] Fix k8s api url for eks clusters (#4559) --- src/components/MAPI/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/MAPI/utils.ts b/src/components/MAPI/utils.ts index 557a6f6e78..fe3d2bab7b 100644 --- a/src/components/MAPI/utils.ts +++ b/src/components/MAPI/utils.ts @@ -1678,7 +1678,9 @@ export function getClusterK8sAPIUrl( hostname = getClusterBaseUrl(cluster, providerFlavor).host; } - return `https://${hostname}${port ? `:${port}` : ''}`; + const url = `${hostname}${port ? `:${port}` : ''}`; + + return url.startsWith('https://') ? url : `https://${url}`; } export function getK8sAPIUrl(providerFlavor: ProviderFlavors): string {