summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-15 16:16:39 -0600
committermo khan <mo@mokhan.ca>2025-05-15 16:16:39 -0600
commit76f0753f2114da1872f0ad286ddd7ebf45e73894 (patch)
tree073f38f5834e433afd64038d7aa25266c47329df /app
parentc151c1a77d31c5e01885691b6df1ea7b0be0b0e5 (diff)
chore: allow envoy to handle health checks
Diffstat (limited to 'app')
-rw-r--r--app/app.go2
-rw-r--r--app/app_test.go7
-rw-r--r--app/controllers/health/controller.go18
-rw-r--r--app/init.go4
4 files changed, 0 insertions, 31 deletions
diff --git a/app/app.go b/app/app.go
index 23f49bb..5bcc69a 100644
--- a/app/app.go
+++ b/app/app.go
@@ -10,7 +10,6 @@ import (
"github.com/xlgmokha/x/pkg/log"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/dashboard"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/health"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/sparkles"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/middleware"
@@ -25,7 +24,6 @@ func New(rootDir string) http.Handler {
mountable := []Mountable{
ioc.MustResolve[*dashboard.Controller](ioc.Default),
- ioc.MustResolve[*health.Controller](ioc.Default),
ioc.MustResolve[*sparkles.Controller](ioc.Default),
}
for _, m := range mountable {
diff --git a/app/app_test.go b/app/app_test.go
index 8817a3c..f1cc28c 100644
--- a/app/app_test.go
+++ b/app/app_test.go
@@ -23,12 +23,5 @@ func TestApp(t *testing.T) {
assert.Equal(t, http.StatusOK, response.Code)
assert.Contains(t, response.Body.String(), "SparkleLab")
})
-
- t.Run("GET /health", func(t *testing.T) {
- response := httptest.NewRecorder()
-
- server.ServeHTTP(response, test.Request("GET", "/health"))
- assert.Equal(t, http.StatusOK, response.Code)
- })
})
}
diff --git a/app/controllers/health/controller.go b/app/controllers/health/controller.go
deleted file mode 100644
index 5bcff66..0000000
--- a/app/controllers/health/controller.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package health
-
-import "net/http"
-
-type Controller struct {
-}
-
-func New() *Controller {
- return &Controller{}
-}
-
-func (c *Controller) MountTo(mux *http.ServeMux) {
- mux.HandleFunc("GET /health", c.Index)
-}
-
-func (c *Controller) Index(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(http.StatusOK)
-}
diff --git a/app/init.go b/app/init.go
index 7ea0dd2..868c2f7 100644
--- a/app/init.go
+++ b/app/init.go
@@ -11,7 +11,6 @@ import (
"github.com/xlgmokha/x/pkg/log"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/dashboard"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/health"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/controllers/sparkles"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/db"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
@@ -38,9 +37,6 @@ func init() {
ioc.Register[*sparkles.Controller](ioc.Default, func() *sparkles.Controller {
return sparkles.New(ioc.MustResolve[domain.Repository[*domain.Sparkle]](ioc.Default))
})
- ioc.Register[*health.Controller](ioc.Default, func() *health.Controller {
- return health.New()
- })
ioc.RegisterSingleton[*http.Client](ioc.Default, func() *http.Client {
return &http.Client{
Transport: &web.Transport{