summaryrefslogtreecommitdiff
path: root/cmd/tfstate/healthz.go
diff options
context:
space:
mode:
authorJulien Dessaux2024-09-28 09:45:03 +0200
committerJulien Dessaux2024-09-28 09:45:03 +0200
commit0f7e13222d087d85c1afd67d22d36f544a39801d (patch)
tree72f935064914ba415d3a41b9c78ef638689d5083 /cmd/tfstate/healthz.go
parentchore(tfstate): initial import (diff)
downloadtfstated-0f7e13222d087d85c1afd67d22d36f544a39801d.tar.gz
tfstated-0f7e13222d087d85c1afd67d22d36f544a39801d.tar.bz2
tfstated-0f7e13222d087d85c1afd67d22d36f544a39801d.zip
feat(tfstate): bootstrap an http server that answers /healthz
Diffstat (limited to '')
-rw-r--r--cmd/tfstate/healthz.go12
1 files changed, 12 insertions, 0 deletions
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("{}"))
+ })
+}