mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-04 11:00:23 +00:00
kill switch added
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user