different appreach without replace

Signed-off-by: Lucas De Souza <lucas.desouza@aa.com>
This commit is contained in:
Lucas De Souza
2023-01-12 15:07:05 -06:00
parent 27710cf922
commit 4203168219
@@ -202,7 +202,12 @@ export class KubernetesClientBasedFetcher implements KubernetesFetcher {
),
);
}
url.pathname = (url.pathname + resourcePath).replace('//', '/');
if (url.pathname === '/') {
url.pathname = resourcePath;
} else {
url.pathname += resourcePath;
}
if (labelSelector) {
url.search = `labelSelector=${labelSelector}`;