From a56b12881bc6645eaf86845bb7b1a4f30d28cad2 Mon Sep 17 00:00:00 2001 From: markcor11 Date: Thu, 9 Jan 2020 16:25:29 +0000 Subject: [PATCH] Detect CHE before Docker Signed-off-by: markcor11 --- pkg/config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index d7ffe163..2b99571f 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -41,13 +41,13 @@ func PFEOriginFromConnection(connection *connections.Connection) (string, *Confi } func getLocalHostnameAndPort() (string, *ConfigError) { + val, ok := os.LookupEnv("CHE_API_EXTERNAL") + if ok && (val != "") { + return "https://localhost:9090", nil + } hostname, port, err := utils.GetPFEHostAndPort() if err != nil || hostname == "" || port == "" { return "", &ConfigError{errOpConfPFEHostnamePortNotFound, nil, "Hostname or port for PFE not found"} } - val, ok := os.LookupEnv("CHE_API_EXTERNAL") - if ok && (val != "") { - return "https://" + hostname + ":" + port, nil - } return "http://" + hostname + ":" + port, nil }