From e35289b870aa5c20d54faefc2a4d5969ffe59a7a Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 8 Jan 2018 17:50:37 +0200 Subject: [PATCH] kill switch added --- pkg/server/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/server/server.go b/pkg/server/server.go index 281ca80..b9422c0 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -27,6 +27,7 @@ func New(options ...func(*Server)) *Server { s.mux.HandleFunc("/", s.index) s.mux.HandleFunc("/healthz/", s.healthz) + s.mux.HandleFunc("/panic/", s.panic) s.mux.Handle("/metrics", promhttp.Handler()) return s @@ -60,6 +61,10 @@ func (s *Server) healthz(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusServiceUnavailable) } +func (s *Server) panic(w http.ResponseWriter, r *http.Request) { + glog.Fatal("Kill switch triggered") +} + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Header().Set("Server", runtime.Version())