@@ -73,31 +73,31 @@ func (ws *remoteWebserverEndpoints) isServerHealthy(w http.ResponseWriter, r *ht
73
73
// If `pg_rewind` is running the Pod is starting up.
74
74
// We need to report it healthy to avoid being killed by the kubelet.
75
75
// Same goes for instances with fencing on.
76
- if ! ws .instance .PgRewindIsRunning && ! ws .instance .MightBeUnavailable () {
77
- err := ws .instance .IsServerHealthy ()
78
- if err != nil {
79
- log .Info ("Liveness probe failing" , "err" , err .Error ())
80
- http .Error (w , err .Error (), http .StatusInternalServerError )
81
- return
82
- }
83
- log .Trace ("Liveness probe succeeding" )
84
- } else {
76
+ if ws .instance .PgRewindIsRunning || ws .instance .MightBeUnavailable () {
85
77
log .Trace ("Liveness probe skipped" )
78
+ _ , _ = fmt .Fprint (w , "Skipped" )
79
+ }
80
+
81
+ err := ws .instance .IsServerHealthy ()
82
+ if err != nil {
83
+ log .Info ("Liveness probe failing" , "err" , err .Error ())
84
+ http .Error (w , err .Error (), http .StatusInternalServerError )
85
+ return
86
86
}
87
+
88
+ log .Trace ("Liveness probe succeeding" )
87
89
_ , _ = fmt .Fprint (w , "OK" )
88
90
}
89
91
90
92
// This is the readiness probe
91
93
func (ws * remoteWebserverEndpoints ) isServerReady (w http.ResponseWriter , r * http.Request ) {
92
- err := ws .instance .IsServerReady ()
93
- if err != nil {
94
+ if err := ws .instance .IsServerReady (); err != nil {
94
95
log .Info ("Readiness probe failing" , "err" , err .Error ())
95
96
http .Error (w , err .Error (), http .StatusInternalServerError )
96
97
return
97
98
}
98
99
99
100
log .Trace ("Readiness probe succeeding" )
100
-
101
101
_ , _ = fmt .Fprint (w , "OK" )
102
102
}
103
103
0 commit comments