Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Detect CHE before Docker
Browse files Browse the repository at this point in the history
Signed-off-by: markcor11 <[email protected]>
  • Loading branch information
markcor11 committed Jan 9, 2020
1 parent fa14385 commit a56b128
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit a56b128

Please sign in to comment.