chore: wrap HTTP server in a dskit module (#71601)

* chore: wrap HTTP server in a dskit module

Much of the logic from this comes from the POC branch, so:
- credit for this work goes to everyone else
- mistakes are my own
This is needed to support microservice deployment modes.
* added an arbitrarily-chosen 30second timeout
This commit is contained in:
Kristin Laemmert
2023-07-18 10:37:53 -04:00
committed by GitHub
parent eff871add9
commit d183a241e9
5 changed files with 62 additions and 35 deletions
+3 -1
View File
@@ -9,6 +9,8 @@ const (
CertGenerator string = "cert-generator"
// GrafanaAPIServer is the Kubertenes API server for Grafana Resources
GrafanaAPIServer string = "grafana-apiserver"
// HTTPServer is the HTTP server for Grafana
HTTPServer string = "http-server"
)
// dependencyMap defines Module Targets => Dependencies
@@ -18,5 +20,5 @@ var dependencyMap = map[string][]string{
CertGenerator: {},
GrafanaAPIServer: {CertGenerator},
All: {BackgroundServices},
All: {BackgroundServices, HTTPServer},
}
+4 -1
View File
@@ -2,8 +2,9 @@ package registry
import (
"github.com/grafana/dskit/services"
"github.com/grafana/grafana-apiserver/pkg/certgenerator"
"github.com/grafana/grafana/pkg/api"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/modules"
"github.com/grafana/grafana/pkg/server/backgroundsvcs"
@@ -22,6 +23,7 @@ func ProvideRegistry(
apiServer grafanaapiserver.Service,
backgroundServiceRunner *backgroundsvcs.BackgroundServiceRunner,
certGenerator certgenerator.ServiceInterface,
httpServer *api.HTTPServer,
) *registry {
return newRegistry(
log.New("modules.registry"),
@@ -29,6 +31,7 @@ func ProvideRegistry(
apiServer,
backgroundServiceRunner,
certGenerator,
httpServer,
)
}
+1 -2
View File
@@ -3,9 +3,8 @@ package registry
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/dskit/services"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/modules"