From 467b1921da4efd09c2432c5745e59f0a3d83f50f Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Mon, 4 Nov 2024 09:13:47 +1100 Subject: [PATCH] chore: add valkey service type --- TESTING_dockercompose.md | 5 +++++ docker-compose.yml | 7 +++++++ main.go | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/TESTING_dockercompose.md b/TESTING_dockercompose.md index bcc79e4..09f73c9 100644 --- a/TESTING_dockercompose.md +++ b/TESTING_dockercompose.md @@ -32,6 +32,7 @@ docker run --rm --net internal-services-test_default jwilder/dockerize dockerize docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://mongo-4:27017 -timeout 1m docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://redis-6:6379 -timeout 1m docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://redis-7:6379 -timeout 1m +docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://valkey-8:6379 -timeout 1m docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://solr-8:8983 -timeout 1m docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://solr-9:8983 -timeout 1m @@ -74,6 +75,10 @@ docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service= docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-7" | grep "SERVICE_HOST=redis-7" docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-7" | grep "LAGOON_TEST_VAR=internal-services-test" +# valkey-8 should be able to read/write data +docker compose exec -T commons sh -c "curl -kL http://go-web:3000/valkey?service=valkey-8" | grep "SERVICE_HOST=valkey-8" +docker compose exec -T commons sh -c "curl -kL http://go-web:3000/valkey?service=valkey-8" | grep "LAGOON_TEST_VAR=internal-services-test" + # solr-8 should be able to read/write data docker compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-8" | grep "SERVICE_HOST=solr-8" docker compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-8" | grep "LAGOON_TEST_VAR=internal-services-test" diff --git a/docker-compose.yml b/docker-compose.yml index 0fd3bd2..39078b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -111,6 +111,13 @@ services: ports: - '6379' + valkey-8: + image: uselagoon/valkey-8:latest + labels: + lagoon.type: redis + ports: + - '6379' + solr-8: image: uselagoon/solr-8:latest labels: diff --git a/main.go b/main.go index 67ea4d1..1a7d0b3 100644 --- a/main.go +++ b/main.go @@ -3,11 +3,12 @@ package main import ( "bytes" "fmt" - "github.com/gorilla/mux" "log" "net/http" "strings" "time" + + "github.com/gorilla/mux" ) type funcType func() map[string]string @@ -22,6 +23,7 @@ func main() { r.HandleFunc("/opensearch", opensearchHandler) r.HandleFunc("/storage", persistentStorageHandler) r.HandleFunc("/mysql", mariadbHandler) + r.HandleFunc("/valkey", redisHandler) r.HandleFunc("/", handleReq) http.Handle("/", r)