CloudMigrations: Avoid building GMS base path when provided (#93793)

Avoid building GMS base path when provided
This commit is contained in:
Roberto Jiménez Sánchez
2024-09-27 09:22:38 +02:00
committed by GitHub
parent 7928245eb6
commit 826245f511
2 changed files with 11 additions and 5 deletions
@@ -35,13 +35,19 @@ func Test_buildBasePath(t *testing.T) {
expected string
}{
{
description: "domain starts with http://localhost, should return domain",
domain: "http://localhost:8080",
description: "domain starts with http://, should return domain",
domain: "http://some-domain:8080",
clusterSlug: "anything",
expected: "http://localhost:8080",
expected: "http://some-domain:8080",
},
{
description: "domain doesn't start with http://localhost, should build a string using the domain and clusterSlug",
description: "domain starts with https://, should return domain",
domain: "https://some-domain:8080",
clusterSlug: "anything",
expected: "https://some-domain:8080",
},
{
description: "domain doesn't start with http or https, should build a string using the domain and clusterSlug",
domain: "gms-dev",
clusterSlug: "us-east-1",
expected: "https://cms-us-east-1.gms-dev/cloud-migrations",