Skip to content

Commit 0a7dddc

Browse files
committed
switch to simple liveness check
Signed-off-by: Chengxuan Xing <[email protected]>
1 parent cbbb7a2 commit 0a7dddc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

internal/apiserver/server.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,10 @@ func (as *apiServer) createMonitoringMuxRouter() *mux.Router {
488488
promhttp.HandlerFor(metrics.Registry(), promhttp.HandlerOpts{})))
489489
}
490490
hf := ffapi.HandlerFactory{}
491-
for _, route := range monitoringRoutes {
492-
r.Path(route.Path).Methods(route.Method).Handler(hf.RouteHandler(route))
493-
}
491+
r.HandleFunc("/livez", hf.APIWrapper(func(res http.ResponseWriter, req *http.Request) (status int, err error) {
492+
// a simple liveness check
493+
return http.StatusOK, nil
494+
}))
494495
r.NotFoundHandler = hf.APIWrapper(func(_ http.ResponseWriter, req *http.Request) (status int, err error) {
495496
return 404, i18n.NewError(req.Context(), i18n.Msg404NotFound)
496497
})

internal/apiserver/spi_routes.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ var spiRoutes = append(globalRoutes([]*ffapi.Route{
3636
})...,
3737
)
3838

39-
var monitoringRoutes = []*ffapi.Route{}
40-
4139
func namespacedSPIRoutes(routes []*ffapi.Route) []*ffapi.Route {
4240
newRoutes := make([]*ffapi.Route, len(routes))
4341
for i, route := range routes {

0 commit comments

Comments
 (0)