Files
podinfo/pkg/api/panic.go
Paul Carlton 19603ddfc1 Fix panic triggering via HTTP API (#197)
Fix GET /panic

The GET /panic api call is not working due the the logger.Panic method
failing to call panic. This change replaces the logger.Panic method
call with logger.Info and adds a call to os.Exit(255).
2022-05-24 12:03:54 +03:00

17 lines
302 B
Go

package api
import (
"net/http"
"os"
)
// Panic godoc
// @Summary Panic
// @Description crashes the process with exit code 255
// @Tags HTTP API
// @Router /panic [get]
func (s *Server) panicHandler(w http.ResponseWriter, r *http.Request) {
s.logger.Info("Panic command received")
os.Exit(255)
}