feat(agent/agentcontainers): add file watcher and dirty status (#17573)

Fixes coder/internal#479
Fixes coder/internal#480
This commit is contained in:
Mathias Fredriksson
2025-04-29 11:53:58 +03:00
committed by GitHub
parent b6146dfe8a
commit 268a50c193
12 changed files with 911 additions and 49 deletions

View File

@ -12,7 +12,7 @@ import (
"github.com/coder/coder/v2/codersdk"
)
func (a *agent) apiHandler() http.Handler {
func (a *agent) apiHandler() (http.Handler, func() error) {
r := chi.NewRouter()
r.Get("/", func(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.Response{
@ -63,7 +63,9 @@ func (a *agent) apiHandler() http.Handler {
r.Get("/debug/manifest", a.HandleHTTPDebugManifest)
r.Get("/debug/prometheus", promHandler.ServeHTTP)
return r
return r, func() error {
return containerAPI.Close()
}
}
type listeningPortsHandler struct {