From 0f7e13222d087d85c1afd67d22d36f544a39801d Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 28 Sep 2024 09:45:03 +0200 Subject: feat(tfstate): bootstrap an http server that answers /healthz --- cmd/tfstate/healthz.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cmd/tfstate/healthz.go (limited to 'cmd/tfstate/healthz.go') diff --git a/cmd/tfstate/healthz.go b/cmd/tfstate/healthz.go new file mode 100644 index 0000000..20c72c9 --- /dev/null +++ b/cmd/tfstate/healthz.go @@ -0,0 +1,12 @@ +package main + +import "net/http" + +func handleHealthz() http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "no-store, no-cache") + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte("{}")) + }) +} -- cgit v1.2.3