diff --git a/TESTING_dockercompose.md b/TESTING_dockercompose.md index 7f7eb95..1fae851 100644 --- a/TESTING_dockercompose.md +++ b/TESTING_dockercompose.md @@ -45,6 +45,14 @@ docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?servic docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-11" | grep "SERVICE_HOST=10.11" docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-11" | grep "LAGOON_TEST_VAR=internal-services-test" +# mysql-8-0 should be able to read/write data +docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-0" | grep "SERVICE_HOST=8.0" +docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-0" | grep "LAGOON_TEST_VAR=internal-services-test" + +# mysql-8-4 should be able to read/write data +docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-4" | grep "SERVICE_HOST=8.4" +docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mysql?service=mysql-8-4" | grep "LAGOON_TEST_VAR=internal-services-test" + # postgres-12 should be able to read/write data docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-12" | grep "SERVICE_HOST=PostgreSQL 12" docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-12" | grep "LAGOON_TEST_VAR=internal-services-test" diff --git a/docker-compose.yml b/docker-compose.yml index c29c69a..2673568 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,6 +57,20 @@ services: ports: - '5432' + mysql-8-0: + image: testlagoon/mysql-8.0:pr-308 + labels: + lagoon.type: mariadb + ports: + - "3306" + + mysql-8-4: + image: testlagoon/mysql-8.4:pr-308 # Placeholder + labels: + lagoon.type: mariadb + ports: + - "3306" + opensearch-2: image: uselagoon/opensearch-2:latest environment: diff --git a/main.go b/main.go index e7ac802..67ea4d1 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,7 @@ func main() { r.HandleFunc("/mongo", mongoHandler) r.HandleFunc("/opensearch", opensearchHandler) r.HandleFunc("/storage", persistentStorageHandler) + r.HandleFunc("/mysql", mariadbHandler) r.HandleFunc("/", handleReq) http.Handle("/", r) @@ -72,7 +73,7 @@ func connectorKeyValues(values []string) string { func cleanRoute(basePath string) (string, string) { cleanRoute := strings.ReplaceAll(basePath, "/", "") - localService := strings.ReplaceAll(cleanRoute, "10.", "10-") + localService := strings.ReplaceAll(cleanRoute, ".", "-") replaceHyphen := strings.ReplaceAll(localService, "-", "_") lagoonService := strings.ToUpper(replaceHyphen) return localService, lagoonService