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

Commit

Permalink
Merge pull request #323 from markcor11/1665-CantCreateProjectsOnChe
Browse files Browse the repository at this point in the history
Detect CHE before Docker
  • Loading branch information
hhellyer authored Jan 10, 2020
2 parents fa14385 + a56b128 commit b1b6ffc
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 b1b6ffc

Please sign in to comment.