Skip to content

Commit

Permalink
add custom logger only log if its not 200
Browse files Browse the repository at this point in the history
Signed-off-by: Rajiv Singh <[email protected]>
  • Loading branch information
rajiv-maersk committed Aug 20, 2024
1 parent 62dc4da commit e24ae3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 10 additions & 3 deletions deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: accesscontrol
image: health:latest # Correct image name
image: ghcr.io/rajiv-maersk/health:main
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
Expand All @@ -39,8 +39,15 @@ spec:
cpu: "40m"
readinessProbe:
httpGet:
path: /health
port: 8082 # Match this to the port your app is listening on
path: /readiness
port: 8082
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 3
livenessProbe:
httpGet:
path: /liveness
port: 8082
initialDelaySeconds: 15
periodSeconds: 20
failureThreshold: 3
3 changes: 1 addition & 2 deletions handlers/handlers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package handlers

import (
"errors"
"net/http"

"github.com/gin-gonic/gin"
Expand All @@ -16,7 +15,7 @@ type HealthResponse struct {

// CheckDatabaseStatus verifies if the database is accessible
func CheckDatabaseStatus() error {
return errors.New("Database connection failed")
return nil
}

// ReadinessProbeHandler returns a Gin handler function that checks the health of the service
Expand Down

0 comments on commit e24ae3a

Please sign in to comment.