feat: adds healtz
This commit is contained in:
parent
df89b1c7d1
commit
aae4a94ffd
@ -6,7 +6,6 @@ tasks:
|
||||
cmds:
|
||||
- task: lint
|
||||
- task: test
|
||||
- task: docker-build
|
||||
- task: docker-local-import
|
||||
- task: test-integration
|
||||
|
||||
@ -15,7 +14,6 @@ tasks:
|
||||
- task: lint
|
||||
- task: test
|
||||
- task: test-integration
|
||||
- task: docker-build
|
||||
- task: docker-publish
|
||||
|
||||
docker-build:
|
||||
@ -24,6 +22,7 @@ tasks:
|
||||
|
||||
docker-local-import:
|
||||
cmds:
|
||||
- task: docker-build
|
||||
- |
|
||||
{{.NIX_CMD_BASE}} \
|
||||
skopeo \
|
||||
@ -44,6 +43,7 @@ tasks:
|
||||
- GITHUB_PASSWORD
|
||||
- GIT_TAG
|
||||
cmds:
|
||||
- task: docker-build
|
||||
- |
|
||||
{{.NIX_CMD_BASE}} \
|
||||
skopeo \
|
||||
|
@ -28,6 +28,11 @@ func New(c config.Config) *Server {
|
||||
s.logFiles = c.LogFiles
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Write([]byte("ok")) //nolint:errcheck
|
||||
})
|
||||
|
||||
mux.HandleFunc("/metrics", s.metrics)
|
||||
|
||||
s.httpServer = &http.Server{
|
||||
|
@ -98,7 +98,8 @@ func TestIntegration(t *testing.T) {
|
||||
Mounts: vol,
|
||||
Image: "caddy-log-exporter:latest",
|
||||
ExposedPorts: []string{"2112:2112"},
|
||||
WaitingFor: wait.ForLog("serving http"),
|
||||
WaitingFor: wait.ForHTTP("http://127.0.0.1:2112/healthz").
|
||||
WithStartupTimeout(5 * time.Minute),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user