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