From 6c2d6c579e42bd93243e29609617c7364424c30b Mon Sep 17 00:00:00 2001 From: tiulpin Date: Thu, 14 Nov 2024 16:24:32 +0200 Subject: [PATCH] :bug: Fix forwarding testing endpoint to containers (QD-10281) --- cloud/endpoints.go | 4 +--- platform/env.go | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cloud/endpoints.go b/cloud/endpoints.go index 0afa25b5..1c78efc5 100644 --- a/cloud/endpoints.go +++ b/cloud/endpoints.go @@ -29,7 +29,6 @@ import ( ) const ( - QodanaEndpointOldEnv = "ENDPOINT" QodanaEndpointEnv = "QODANA_ENDPOINT" QodanaCloudRequestCooldownEnv = "QODANA_CLOUD_REQUEST_COOLDOWN" QodanaCloudRequestTimeoutEnv = "QODANA_CLOUD_REQUEST_TIMEOUT" @@ -76,8 +75,7 @@ func GetCloudRootEndpoint() *QdRootEndpoint { if endpoint != nil { return endpoint } - oldEnvValue := GetEnvWithDefault(QodanaEndpointOldEnv, DefaultEndpoint) - userUrl := GetEnvWithDefault(QodanaEndpointEnv, oldEnvValue) + userUrl := GetEnvWithDefault(QodanaEndpointEnv, DefaultEndpoint) host, err := parseRawURL(userUrl) if err != nil { log.Fatal(err) diff --git a/platform/env.go b/platform/env.go index 28e52ff0..bdfd4b83 100644 --- a/platform/env.go +++ b/platform/env.go @@ -18,6 +18,7 @@ package platform import ( "fmt" + "github.com/JetBrains/qodana-cli/v2024/cloud" cienvironment "github.com/cucumber/ci-environment/go" log "github.com/sirupsen/logrus" "net/url" @@ -61,6 +62,9 @@ func ExtractQodanaEnvironment(setEnvironmentFunc func(string, string)) { if license := os.Getenv(QodanaLicense); license != "" { setEnvironmentFunc(QodanaLicense, license) } + if endpoint := os.Getenv(cloud.QodanaEndpointEnv); endpoint != "" { + setEnvironmentFunc(cloud.QodanaEndpointEnv, endpoint) + } if remoteUrl := os.Getenv(QodanaRemoteUrl); remoteUrl != "" { setEnvironmentFunc(QodanaRemoteUrl, remoteUrl) }