slaventius 2 years ago
parent 28434a9fa7
commit 8aaba4e0d9
  1. 2
      deploy/auth-deployment.yaml
  2. 6
      internal/auth.go

@ -25,7 +25,7 @@ spec:
name: auth-config name: auth-config
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /api/v1/health path: /api/v1/healthz
port: 9994 port: 9994
periodSeconds: 1 periodSeconds: 1
initialDelaySeconds: 3 initialDelaySeconds: 3

@ -32,7 +32,7 @@ func NewServer(ctx context.Context, config *config.Config) *AuthServer {
} }
// //
s.Router.Get("/api/v1/health", health(s)) s.Router.Get("/api/v1/healthz", healthz(s))
// //
s.Router.Post("/api/v1/login", login(s)) s.Router.Post("/api/v1/login", login(s))
@ -46,9 +46,9 @@ func (s *AuthServer) GracefulStop() error {
return s.db.Close() return s.db.Close()
} }
func health(s *AuthServer) http.HandlerFunc { func healthz(s *AuthServer) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200) w.WriteHeader(http.StatusOK)
w.Write([]byte("ok")) w.Write([]byte("ok"))
} }
} }

Loading…
Cancel
Save