From 28434a9fa797b6d7c65e80f116f6abfe99d6694c Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 09:06:00 +0300 Subject: [PATCH] * --- deploy/auth-deployment.yaml | 4 ++-- internal/auth.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deploy/auth-deployment.yaml b/deploy/auth-deployment.yaml index b0f9658..f6c35e9 100644 --- a/deploy/auth-deployment.yaml +++ b/deploy/auth-deployment.yaml @@ -25,9 +25,9 @@ spec: name: auth-config readinessProbe: httpGet: - path: /api/v1/ready + path: /api/v1/health port: 9994 periodSeconds: 1 initialDelaySeconds: 3 - failureThreshold: 1 + failureThreshold: 2 successThreshold: 1 diff --git a/internal/auth.go b/internal/auth.go index cac8906..75238bd 100644 --- a/internal/auth.go +++ b/internal/auth.go @@ -32,8 +32,7 @@ func NewServer(ctx context.Context, config *config.Config) *AuthServer { } // - s.Router.Get("/api/v1/live", live(s)) - s.Router.Get("/api/v1/ready", live(s)) + s.Router.Get("/api/v1/health", health(s)) // s.Router.Post("/api/v1/login", login(s)) @@ -47,8 +46,9 @@ func (s *AuthServer) GracefulStop() error { return s.db.Close() } -func live(s *AuthServer) http.HandlerFunc { +func health(s *AuthServer) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) w.Write([]byte("ok")) } }